I'm guessing that when you are writing your values, you are writing
numbers to the file and not strings. With numbers, the significant
floating-point values are obviously preserved, but a number like 12.00
will be written as just 12. Try either casting the value to a string, or
having PHP
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
://www.thelonecoder.com
continuing the struggle against bad code
http://www.fortheloveofgeeks.com
I¹m a geek and I¹m OK!
--
From: Tom Shaw [EMAIL PROTECTED]
Date: Mon, 8 Sep 2008 15:53:58 -0500
To: PHP list - not junk php-general@lists.php.net
Subject: [PHP] CSV output.
I'm outputting a bunch
-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
]
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:[EMAIL PROTECTED]
Sent: Monday, September 08, 2008 3:54 PM
To: php-general@lists.php.net
Subject: [PHP] CSV output.
I'm
On Sep 8, 2008, at 5:06 PM, Tom Shaw wrote:
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.
Did you mean to say that it .00 _doesn't_ show up when you try to
manually add a .00?
The value is in the array or string
Tom Shaw wrote:
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
wrong.
-Original Message-
From: Eric Gorr [mailto:[EMAIL PROTECTED]
Sent: Monday, September 08, 2008 4:21 PM
To: PHP General
Subject: Re: [PHP] CSV output.
On Sep 8, 2008, at 5:06 PM, Tom Shaw wrote:
Actually that won't work I tried it. For some reason the .00 shows
up when I
try
Subject: Re: [PHP] CSV output.
On Sep 8, 2008, at 5:06 PM, Tom Shaw wrote:
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.
Did you mean to say that it .00 _doesn't_ show up when you try to
manually add
, 2008 4:21 PM
To: PHP General
Subject: Re: [PHP] CSV output.
On Sep 8, 2008, at 5:06 PM, Tom Shaw wrote:
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.
Did you mean to say that it .00 _doesn't_ show up when you try
$out; This prints wrong.
-Original Message-
From: Eric Gorr [mailto:[EMAIL PROTECTED]
Sent: Monday, September 08, 2008 4:21 PM
To: PHP General
Subject: Re: [PHP] CSV output.
On Sep 8, 2008, at 5:06 PM, Tom Shaw wrote:
Actually that won't work I tried it. For some reason the .00 shows
up
I have a PHP script that outputs several lines of comma separated values.. I
would like to display this output in Excel without having to write the
output to a file with a .csv extension and redirecting.
I have tried setting the content-type: application/vnd.ms-excel and Excel
isn't happy.. it
12 matches
Mail list logo