1
0
mirror of https://github.com/php/php-src.git synced 2026-04-28 18:53:33 +02:00

@ Fix bug in number_format (Jon Forsberg)

This commit is contained in:
Andi Gutmans
2000-04-15 13:53:32 +00:00
parent 81138a641a
commit f2ff9eeef5
+2 -1
View File
@@ -25,6 +25,7 @@
#include "phpmath.h"
#include <math.h>
#include <float.h>
#ifndef M_PI
#define M_PI 3.14159265358979323846
@@ -612,7 +613,7 @@ char *_php_math_number_format(double d,int dec,char dec_point,char thousand_sep)
d = -d;
}
dec = MAX(0,dec);
tmpbuf = (char *) emalloc(32+dec);
tmpbuf = (char *) emalloc(1+DBL_MAX_10_EXP+1+dec+1);
tmplen=sprintf(tmpbuf,"%.*f",dec,d);