Formatting Currency

M

Mitchell Vincent

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! :)
 
M

Marina

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

Cor Ligthert

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/d...emglobalizationnumberformatinfoclasstopic.asp

I hope this helps,

Cor

..
 
M

Mitchell Vincent

Mitchell said:
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!
 
P

Peter Huang [MSFT]

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.
 

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

Top