diff options
| author | Ilia Alshanetsky <iliaa@php.net> | 2007-10-01 15:22:41 +0000 |
|---|---|---|
| committer | Ilia Alshanetsky <iliaa@php.net> | 2007-10-01 15:22:41 +0000 |
| commit | 36cf6a2b051a2f67b747f02e0f0b3eb1525be48f (patch) | |
| tree | a947da435f0282e7c36ccaec8d58732c28c71f63 /main/snprintf.c | |
| parent | 5f15b1ef7afb377a3e9a01c170c1a49df907040b (diff) | |
| download | php-git-36cf6a2b051a2f67b747f02e0f0b3eb1525be48f.tar.gz | |
Fixed bug #42785 (json_encode() formats doubles according to locale rather
then following standard syntax).
Diffstat (limited to 'main/snprintf.c')
| -rw-r--r-- | main/snprintf.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/main/snprintf.c b/main/snprintf.c index 853a078885..54820e804e 100644 --- a/main/snprintf.c +++ b/main/snprintf.c @@ -1004,6 +1004,7 @@ static int format_converter(register buffy * odp, const char *fmt, va_list ap) / case 'g': + case 'k': case 'G': case 'H': switch(modifier) { @@ -1045,7 +1046,7 @@ static int format_converter(register buffy * odp, const char *fmt, va_list ap) / lconv = localeconv(); } #endif - s = php_gcvt(fp_num, precision, *fmt=='H' ? '.' : LCONV_DECIMAL_POINT, (*fmt == 'G' || *fmt == 'H')?'E':'e', &num_buf[1]); + s = php_gcvt(fp_num, precision, (*fmt=='H' || *fmt == 'k') ? '.' : LCONV_DECIMAL_POINT, (*fmt == 'G' || *fmt == 'H')?'E':'e', &num_buf[1]); if (*s == '-') { prefix_char = *s++; } else if (print_sign) { |
