cvs: php4 /ext/standard/ math.c
| From: | Andrei Zmievski | Date: | Tue, 13 Jun 2000 04:31:02 +0000 |
| Subject: | cvs: php4 /ext/standard/ math.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-220@lists.php.net to get a copy of this message | ||
andrei Mon Jun 12 21:31:02 2000 EDT
Modified files:
/php4/ext/standard math.c
Log:
(php_math_number_format) Simplifying the logic also fixed bugs #4954
and #4998.
Index: php4/ext/standard/math.c
diff -u php4/ext/standard/math.c:1.29 php4/ext/standard/math.c:1.30
--- php4/ext/standard/math.c:1.29 Mon Jun 12 08:17:08 2000
+++ php4/ext/standard/math.c Mon Jun 12 21:31:02 2000
@@ -636,14 +636,6 @@
return tmpbuf;
}
- if (dec_point!='.') {
- for (t=tmpbuf; *t; t++) {
- if (*t=='.') {
- *t = dec_point;
- break;
- }
- }
- }
if (dec) {
reslen = dec+1 + (tmplen-dec-1) + (tmplen-1-dec-1)/3;
} else {
@@ -659,10 +651,11 @@
*t-- = 0;
if (dec) {
- while (*s!=dec_point) {
+ while (isdigit((int)*s)) {
*t-- = *s--;
}
- *t-- = *s--; /* copy that dot */
+ *t-- = dec_point; /* copy that dot */
+ s--;
}
while(s>=tmpbuf) {