From: Felipe Pena Date: Thu, 16 Jul 2009 00:59:34 +0000 (+0000) Subject: - Removed trailing zeros on double to string conversion (noticed on #48924) X-Git-Tag: php-5.3.1RC1~381 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2adf42f8904fd2b293f6a8281690de4cdc62b0c4;p=php - Removed trailing zeros on double to string conversion (noticed on #48924) --- diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index 0800d23d29..c937f68714 100755 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -317,7 +317,7 @@ static int really_register_bound_param(struct pdo_bound_param_data *param, pdo_s if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_STR && param->max_value_len <= 0 && ! ZVAL_IS_NULL(param->parameter)) { if (Z_TYPE_P(param->parameter) == IS_DOUBLE) { char *p; - int len = spprintf(&p, 0, "%F", Z_DVAL_P(param->parameter)); + int len = spprintf(&p, 0, "%.*H", (int) EG(precision), Z_DVAL_P(param->parameter)); ZVAL_STRINGL(param->parameter, p, len, 0); } else { convert_to_string(param->parameter);