You are here: Re: strange number format « PHP Programming Language « IT news, forums, messages
Re: strange number format

Posted by toffee on 12/18/06 22:58

Excel spreadsheet not CSV

the extra thousand could be due to fact i have 4 decimals setup in mysql
table.

is there a way in PHP to detect whether it's a dutch locale? maybe then i
could just format the numbers to strip the decimals

"Rik" <luiheidsgoeroe@hotmail.com> wrote in message
news:76251$45871664$8259c69c$7558@news2.tudelft.nl...
> toffee wrote:
> > Hi all,
> >
> > I created a little button which when clicked will run a query on
> > mysql db and output the results as an excel spreadsheet.
>
> Really as an Excel spreadsheet or a csv?
>
> > I do this by setting the header as application excel. All works well
> > except for a very strange problem. Let's say a column should say
> > 16500.22. When I run it here from the uk, the cell will show 16500.22
> > When someone in Netherlands runs it, the cells shows 16,500,220,000
> >
> > It looks like Excel is mixing the commas and dot somewhere along the
> > line ?
> >
> > Anyway know what I can do to keep my colleagues from holland happy ?
>
> Well, it has offcourse got to do with the fact that the dot is the
> thousands-seperator, and the comma is the decimal seperator, at least here
> in Holland :P.
> As far as a Dutch version of Excel is concerned, an number formatted like
> 16500.22 is gibberish. I would have thought it would choose either to
> display is as text, or as 165,000,220 (well, they'd see it as
165.000.220),
> but where the extra thousand comes from I wouldn't know.
>
> It offcourse has something to do with locale-settings. I have cracked this
> one before, but fortunately for me, unfortunately for you, I'm no longer
> forced to deal with MS Office, and I haven't got a clue wether is was
Excel
> or Windows that had to be pounded into shape.
>
> Afaik when you import a csv instead of opening it just like an Excel
> document, one can choose the decimal seperator BTW. Not very user
friendely
> though.
>
> Either:
> - ask on microsoft.public.excel or better yet
> microsoft.public.nl.office.excel (as there obviously will be more dutch
> aware of this issue)
> - create a settings before the output how to format numbers (either in
> dutch or reversed :-)
>
> Nothing to do with PHP obviously.
> --
> Rik Wasmus
>
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация