Skip to main content
Participant
October 20, 2008
Frage

Thousand and decimal seperators

  • October 20, 2008
  • 2 Antworten
  • 541 Ansichten
Delete please
    Dieses Thema wurde für Antworten geschlossen.

    2 Antworten

    Inspiring
    October 20, 2008
    Wubzorz wrote:

    > I have a question I need to convert a european number (. as thousand seperator

    what's a "european" number anyway? there are a lot of numeric formats besides
    commas & decimals, eg. some locales use spaces as thousand delimiters.

    > Is there a method to determine what kind of number I'm dealing with?

    no not really.

    i would wrap a try block around an isNumeric() test of the incoming number. if
    it fails then i guess you can start trying to guess which locale it came from &
    do an lsParseNumber on it.

    Inspiring
    October 20, 2008
    where is this data coming from? user input in form or a csv/text file?
    i am asking because it is a lot easier to enforce data entry in a
    certain format than to try and guess what format the data was entered in
    and then try to convert from one format to another...

    if you can't completely control data format at entry, can you at least
    enforce some format control, i.e. is number of decimal places always the
    same or varying?

    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com/