I'm trying to create a Winform that allows a user to select a currency symbol AND a currency format (by inputting the locale for it).
I would like to have a number follow that selected format but yet ignore the default Currency Symbol belonging to .
EX: If a user select "$" as txtCurrencySymbol
but wants it formatted in the "hi-IN" Locale, so that it would appear as "$10,00,000
" what would the coding be for that?
I found an answer for a question similar to mine, however it is written in JAVA (and I'm using VB.NET).
Currency symbol with another number format
Here is a bit of the coding that I have so far:
If rbCurrencyDollar.Checked = True Then
' We're using the dollar... so, set the Currency Symbol to $
txtCurrencySymbol.Text = "$"
' Set the Locale to en-US
txtCurrencyLocale.Text = "en-US"
' Disable the TXT boxes so that no one can edit them.
txtCurrencyLocale.Enabled = False
txtCurrencySymbol.Enabled = False
'NumberFormatInfo.CurrentInfo.CurrencySymbol = "$"
Dim nfi = New NumberFormatInfo()
nfi.CurrencySymbol = "$"
lblSampleCurrency.Text = 1000000.ToString("C", nfi)
End If
Now the problem here is that, the number will display not at $1,000,000
but instead as "$1,000,000.00".