By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,258 Members | 1,251 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,258 IT Pros & Developers. It's quick & easy.

Formatting decimal number

P: n/a
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/
Nov 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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" <lu*******@haceb.com> wrote in message
news:OS****************@tk2msftngp13.phx.gbl...
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/

Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.