
November 14th, 2008, 12:48 AM
|
 |
Code Monkey V. 0.9
|
|
Join Date: Mar 2005
Location: A Land Down Under
|
|
Quote: | Originally Posted by BikeMaster number_format() is great for formatting, but could screw things up if your output isn't expecting a comma (like in an XML-driven chart. |
That's why there's the optional parameters on number_format. To make a purely numerical value you'd use:
Code:
$val = number_format ($val, 2, ".", "");
That adds in the decimal place, but removes the other separators for thousands, etc.
|