money datatype
-
hi all, Jsut a quick question, I have a product database with a productcost field, when i enter a cost into the field i use for exemple £100 or £0.50. When I run my website in asp.net it shows a dollar sign $ instead of a pound sign. Any ideas on how to correct this? I have checked the help files in SQL server 2000 and also in visual studio.net...cant find anything related....its gotta be something easy?? Thanks in advance!
-
hi all, Jsut a quick question, I have a product database with a productcost field, when i enter a cost into the field i use for exemple £100 or £0.50. When I run my website in asp.net it shows a dollar sign $ instead of a pound sign. Any ideas on how to correct this? I have checked the help files in SQL server 2000 and also in visual studio.net...cant find anything related....its gotta be something easy?? Thanks in advance!
Is your website hosted in the same machne where you edit the database? If not, your machine probably is configured (in Control Panel, Regional settings) to format the currency values like British (pounds). And probably the ASP.NET server is configured for an english-US culture. Do something like this in your ASP.NET code:
CultureInfo ci = new CultureInfo("en-br"); // Check the "en-br" so it's for Britain, maybe "en-UK" decimal dMyMoney = 12.99m; string strMoneyInPounds = dMyMoney.ToString("c", ci);
I'm not exactly sure of the syntax, but that should format your
decimal
value as currency (the"c"
parameter) using the English (UK variant) culture. -- LuisR
Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!
-
Is your website hosted in the same machne where you edit the database? If not, your machine probably is configured (in Control Panel, Regional settings) to format the currency values like British (pounds). And probably the ASP.NET server is configured for an english-US culture. Do something like this in your ASP.NET code:
CultureInfo ci = new CultureInfo("en-br"); // Check the "en-br" so it's for Britain, maybe "en-UK" decimal dMyMoney = 12.99m; string strMoneyInPounds = dMyMoney.ToString("c", ci);
I'm not exactly sure of the syntax, but that should format your
decimal
value as currency (the"c"
parameter) using the English (UK variant) culture. -- LuisR
Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!