Formatting decimal number

Discussion in 'ASP .Net' started by Luis Esteban Valencia, Jan 12, 2005.

  1. Hi

    My website is hosted in Germany, and decimal numbers are displayed as
    "123,456" rather than in the UK format I want: "123.456". I therefore need
    to know the ASP.NET/VB.NETfunction/method for displaying numbers in UK
    format, and the function for converting my input textbox entries from UK
    format to German format, for input into the German sqlserver.

    Any help gratefully received.


    --
    LUIS ESTEBAN VALENCIA
    MICROSOFT DCE 3.
    MIEMBRO ACTIVO DE ALIANZADEV
    http://spaces.msn.com/members/extremed/
    Luis Esteban Valencia, Jan 12, 2005
    #1
    1. Advertising

  2. You could convert it using the appropriate CultureInfo.
    eg.

    decimal converted = Convert.ToDecimal("123,456", (new
    CultureInfo("en-GB")).NumberFormat));

    (You can replace "en-GB" with any supported culture name (see the
    documentation for the System.Globalization.CultureInfo class), and I'm not
    sure if my syntax is 100% correct).

    --
    Philip Q
    Microsoft MVP [ASP.NET]

    "Luis Esteban Valencia" <> wrote in message
    news:OStwKcJ%...
    > Hi
    >
    > My website is hosted in Germany, and decimal numbers are displayed as
    > "123,456" rather than in the UK format I want: "123.456". I therefore need
    > to know the ASP.NET/VB.NETfunction/method for displaying numbers in UK
    > format, and the function for converting my input textbox entries from UK
    > format to German format, for input into the German sqlserver.
    >
    > Any help gratefully received.
    >
    >
    > --
    > LUIS ESTEBAN VALENCIA
    > MICROSOFT DCE 3.
    > MIEMBRO ACTIVO DE ALIANZADEV
    > http://spaces.msn.com/members/extremed/
    >
    >
    Philip Q [MVP], Jan 12, 2005
    #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. makok
    Replies:
    1
    Views:
    6,752
    Anders Hellerup Madsen
    Feb 23, 2004
  2. BoomerangThree
    Replies:
    3
    Views:
    408
    Jacob
    Aug 20, 2004
  3. stu
    Replies:
    13
    Views:
    6,223
    Ranganath Kini
    Feb 7, 2006
  4. muss
    Replies:
    13
    Views:
    709
    Vladimir S. Oka
    Mar 27, 2006
  5. Replies:
    0
    Views:
    275
Loading...

Share This Page