Re: number_format()
| From: | Stas Trefilov | Date: | Fri, 14 Jul 2000 16:25:40 +0000 |
| Subject: | Re: number_format() | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-1093@lists.php.net to get a copy of this message | ||
Joshua Pyle wrote:
>
> Number format crashes php every time I assign its output to a variable.
> Anyone know a way around this.
Got the same problem. In my case problem was in my locale (Russian), where
decimal delimiter is ',' not '.'. So to stop number_format () from crashing
a call to str_replace () is needed.
I mean
echo number_format ($str, 2, ".", "'");
should become
echo number_format (str_replace (",", ".", $str), 2, ".",
"'");
--
Stas Trefilov
Moscow Russia