RE: [PHP] CSV output.

From: Date: Mon, 08 Sep 2008 21:06:38 +0000
Subject: RE: [PHP] CSV output.
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-279699@lists.php.net to get a copy of this message
Actually that won't work I tried it. For some reason the .00 shows up when I try to manually add a .00. I know weird. The value is in the array or string before outputting printing to CSV. Number format does not work either. -----Original Message----- From: Boyd, Todd M. [mailto:tmboyd1@ccis.edu] Sent: Monday, September 08, 2008 3:59 PM To: Tom Shaw; php-general@lists.php.net Subject: RE: [PHP] CSV output. > -----Original Message----- > From: Tom Shaw [mailto:php.coder@tx.rr.com] > 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

« previous php.general (#279699) next »