|
-
Aug 2nd, 2010, 12:00 PM
#1
Thread Starter
New Member
ToString value for mexican pesos
I know that i use a "c" for American Currency is there a ToString value used for Mexican Pesos?
-
Aug 2nd, 2010, 12:05 PM
#2
Re: ToString value 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
-
Aug 2nd, 2010, 12:21 PM
#3
Re: ToString value for mexican pesos
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...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|