> -----Original Message-----
> From: Tom Shaw [mailto:[EMAIL PROTECTED]
> Sent: Monday, September 08, 2008 3:54 PM
> To: php-general@lists.php.net
> Subject: [PHP] CSV output.
> 
> I'm outputting a bunch of numerical values for a spreadsheet to
> calculate
> total sales among other things on a client shopping cart. I'm running
> into
> problems with values that contain zeros after the decimal. If a value
> is
> 234.55 the value outputs fine to the CSV file but if the value is
> 234.00
> only 234 shows up. Is there any way to force the zeros into the
> spreadsheet?

When you say "shows up", do you mean in the *.csv file itself or the
application you are using to view it? If the .00 isn't showing up in the
file itself, test to see if the number being output is a whole number.
If it is, then write ".00" afterwards. (Quick and dirty, I know... but
it sounds like that's what you're trying to accomplish.)


Todd Boyd
Web Programmer




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to