summaryrefslogtreecommitdiff
path: root/main/snprintf.c
diff options
context:
space:
mode:
authorDerick Rethans <derick@php.net>2007-06-19 12:20:50 +0000
committerDerick Rethans <derick@php.net>2007-06-19 12:20:50 +0000
commit3b481cef649e31ca6d28be5f9121c4bc48784e66 (patch)
tree906994a2f0ac46310a73f1c53883c8a3fbc59a91 /main/snprintf.c
parent0475096ea1679ee3ff97dea82613c61183bae7c4 (diff)
downloadphp-git-3b481cef649e31ca6d28be5f9121c4bc48784e66.tar.gz
- MFH: Added the H modifier to create non-locale-aware non-fixed-precision
float representations. - MFH: Fixed var_export() to use the new H modifier so that it can generate parsable PHP code for floats again, independent of the locale.
Diffstat (limited to 'main/snprintf.c')
-rw-r--r--main/snprintf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/main/snprintf.c b/main/snprintf.c
index 854e62b64c..d9aca450c3 100644
--- a/main/snprintf.c
+++ b/main/snprintf.c
@@ -996,6 +996,7 @@ static int format_converter(register buffy * odp, const char *fmt, va_list ap) /
case 'g':
case 'G':
+ case 'H':
switch(modifier) {
case LM_LONG_DOUBLE:
fp_num = (double) va_arg(ap, long double);
@@ -1035,7 +1036,7 @@ static int format_converter(register buffy * odp, const char *fmt, va_list ap) /
lconv = localeconv();
}
#endif
- s = php_gcvt(fp_num, precision, LCONV_DECIMAL_POINT, (*fmt == 'G')?'E':'e', &num_buf[1]);
+ s = php_gcvt(fp_num, precision, *fmt=='H' ? '.' : LCONV_DECIMAL_POINT, (*fmt == 'G')?'E':'e', &num_buf[1]);
if (*s == '-') {
prefix_char = *s++;
} else if (print_sign) {