Posted by jerryyang_la1 on 08/24/07 07:40
I need some advice on formatting numbers using PHP.
My database holds numbers like:
10
0.2
I need these to be displayed as
10.00
0.20
I'll add the '£' sign, so the end result is
£10.00
£0.20
How do I do that. ? The vaule are coming from $number
Also some of the numbers may be negatives:
-0.3
-5
Is there any easy way to detect negitives ?
Ideally I'd like to be able to show positive number in one color and
negitive in red on screen.
Thanks :)
[Back to original message]
|