Formatting decimal number

  • Thread starter Luis Esteban Valencia
  • Start date
L

Luis Esteban Valencia

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.
 
P

Philip Q [MVP]

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).
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top