]> granicus.if.org Git - php/commitdiff
- MFH: Removed trailing zeros on double to string conversion (noticed on #48924)
authorFelipe Pena <felipe@php.net>
Thu, 16 Jul 2009 01:00:22 +0000 (01:00 +0000)
committerFelipe Pena <felipe@php.net>
Thu, 16 Jul 2009 01:00:22 +0000 (01:00 +0000)
ext/pdo/pdo_stmt.c

index c9bd8fa995319566888f9fb7025d4e316810d9fc..d5c618ea0b3963aa7430292ee432216a2c765554 100755 (executable)
@@ -329,7 +329,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);