I know that i use a "c" for American Currency is there a ToString value used for Mexican Pesos?
Printable View
I know that i use a "c" for American Currency is there a ToString value used for Mexican Pesos?
"c" is currency... and is based on the local regional settings... so if your local region currency settings isn't Pesos... you'll have to simple format it yourself, as a number, with the appropriate currency symbol, thousands separator, and decimal notation.
-tg
even if your local region isn't Mexico, you can still call up the mexican culture info and apply it, however I think you will find even that doesn't support "pesos" really.
If I have ten dollars and 50 cents in USD, and I was going to represent that in code I would have
Dim myMoney as Double = 10.50
Dim myString as String = myMoney.ToString("C") 'produces $10.50
Now if you were to call up the mexican culture
Dim myMoney As Double = 10.5
Dim mexicanCulture = System.Globalization.CultureInfo.CreateSpecificCulture("es-MX")
Dim myString As String = myMoney.ToString("C", mexicanCulture)
You are still going to get "$10.50" because as far as the programming language is concerned, you are just formatting the numeric value of 10.50 into a string with currency formatting applied. Peso and Dollar use the same symbol $. It isn't doing dollar to peso conversions, those aren't even values that stay static, the conversion rate between currencies is a constantly changing thing...