RE: [PHP-WIN] RE: decimal numbers

2001-01-10 Thread Boget, Chris
> You need to use sprintf or printf to format the output. Here's the > necessary code: > $Percent = sprintf ("%0.2f", $Percent); > If you use printf it will print the result, whereas sprintf > (as used above) returns the string and lets you assign it to a variable > instead. > More info here:

[PHP-WIN] RE: decimal numbers

2001-01-10 Thread Simon Willison
You need to use sprintf or printf to format the output. Here's the necessary code: $Percent = sprintf ("%0.2f", $Percent); If you use printf it will print the result, whereas sprintf (as used above) returns the string and lets you assign it to a variable instead. More info here: http://www.ph