Board index » Visual Studio » Formatting Currency

Formatting Currency

Visual Studio279
How is everyone formatting currency with VB.NET?



Before I was calling the API function for it, which took the currency

symbol from the Windows settings. I've found this to be limited when

working with European countries where business in conducted in several

different currencies. Are you guys just storing a currency symbol and

formatting the number accordingly? What about the comma and decimal

switch that some locales use?



I hope .NET makes this easy for me! :-)



--

- Mitchell Vincent

- kBilling - Invoices Made Easy!

- www.k-billing.com


-
 

Re:Formatting Currency

I would say you are better off storing a list of currency codes, symbols,

and decimal places for each currency. I don't think windows settings can

keep up with different currencies, what countries are using which ones, etc.



This also means, that when whatever after .NET comes out, your port will be

easy. You won't have to figure out how to do this in some other framework.



"Mitchell Vincent" <mvincent@newsgroup.nospam>wrote in message

Quote
How is everyone formatting currency with VB.NET?



Before I was calling the API function for it, which took the currency

symbol from the Windows settings. I've found this to be limited when

working with European countries where business in conducted in several

different currencies. Are you guys just storing a currency symbol and

formatting the number accordingly? What about the comma and decimal switch

that some locales use?



I hope .NET makes this easy for me! :-)



--

- Mitchell Vincent

- kBilling - Invoices Made Easy!

- www.k-billing.com">www.k-billing.com





-

Re:Formatting Currency

Mitchell.



The currency difference in the States in Europe is now probably not more

than in America.The oldest 6 EU states plus Ireland, Greece, Spain,

Portugal, Finland, and Austria use the Euro.



In the local settings of the computer are the currencies, and when you do it

right you have almost nothing to do.



There are only two states in Europe that uses a point as decimal point

separator the UK and Ireland. (The same as in America, beside all the States

of the US and English speaking Canada).



However normally there is nothing to do for it, it is a part of the Net and

the OS.



Look for it especially to the overloading ToString and the numberformatinfo



http://msdn.microsoft.com/library/default.asp?url" rel="nofollow" target="_blank">msdn.microsoft.com/library/default.asp=/library/en-us/cpref/html/frlrfsystemglobalizationnumberformatinfoclasstopic.asp



I hope this helps,



Cor



.





-

Re:Formatting Currency

Mitchell Vincent wrote:

Quote
How is everyone formatting currency with VB.NET?



Before I was calling the API function for it, which took the currency

symbol from the Windows settings. I've found this to be limited when

working with European countries where business in conducted in several

different currencies. Are you guys just storing a currency symbol and

formatting the number accordingly? What about the comma and decimal

switch that some locales use?



I hope .NET makes this easy for me! :-)





For future reference :



Dim Price as Double = 10.00



Debug.Writeline(String.Format("{0:c}", Price)



Does it!



--

- Mitchell Vincent

- kBilling - Invoices Made Easy!

- www.k-billing.com">www.k-billing.com

-

Re:Formatting Currency

Hi



Thanks for your experience sharing.

If you still have any concern, please feel free to post here.



Best regards,



Peter Huang

Microsoft Online Partner Support



Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties, and confers no rights.



-