Decimal.toString() for any region using VB.NET
18:59 13 Apr 2009

I have an application that deals with currency. For display purposes I use the nifty VB FormatCurrency function which will format based on the OS's region setting. So, if in France you might get 123,45 whereas in the US you would get 123.45.

To perform the calculation on these amounts I use CDec() to convert to decimal.

My problem is that when I convert the Decimal to a String using toString() it formats according to the currently set region. I need to be able to always convert the decimal into a String representation for the US, i.e. with decimal points.

I thought I would be able to do something similar to this: .toString("#0.00")

vb.net formatting locale currency regional-settings