RE: CSV output.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: Tom Shaw [mailto:php.coder@xxxxxxxxx]
> Sent: Monday, September 08, 2008 3:54 PM
> To: php-general@xxxxxxxxxxxxx
> Subject:  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



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux