Help converting user input to double

Discussion in 'ASP .Net' started by Torben Laursen, Sep 14, 2006.

  1. Hi

    I have a problem that should be simple but I have been unable to solve it

    The users of my homepage is all over the planet and they all enter numbers
    in texbox's and I give them some numbers back

    But how do I make sure that my server allways read the values correct no
    matter if the user writes 10.1 or 10,1?

    Thanks Torben
     
    Torben Laursen, Sep 14, 2006
    #1
    1. Advertising

  2. You have a couple of choices:

    1. Turn commas into periods prior to setting the double.
    2. Use globalization.

    Most likely you will need to do both as some users do not set their language
    properly, which throws off globalization/localization.

    Hope this helps.

    --
    Gregory A. Beamer
    MVP; MCP: +I, SE, SD, DBA

    *************************************************
    Think Outside the Box!
    *************************************************
    "Torben Laursen" <> wrote in message
    news:%...
    > Hi
    >
    > I have a problem that should be simple but I have been unable to solve it
    >
    > The users of my homepage is all over the planet and they all enter numbers
    > in texbox's and I give them some numbers back
    >
    > But how do I make sure that my server allways read the values correct no
    > matter if the user writes 10.1 or 10,1?
    >
    > Thanks Torben
    >
     
    Cowboy \(Gregory A. Beamer\), Sep 15, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. D. Shane Fowlkes
    Replies:
    2
    Views:
    590
    D. Shane Fowlkes
    Dec 16, 2004
  2. pop
    Replies:
    4
    Views:
    428
    Roedy Green
    Jun 17, 2004
  3. da Vinci
    Replies:
    5
    Views:
    8,769
    da Vinci
    Jul 31, 2004
  4. Sydex
    Replies:
    12
    Views:
    6,646
    Victor Bazarov
    Feb 17, 2005
  5. shang
    Replies:
    5
    Views:
    304
    Marcus Kwok
    Oct 21, 2005
Loading...

Share This Page