nsdlsandy
asked on
Problem with localization for international users
I have a payment processing screen which work great for US based users. But for some users outside of US in Chile and Brazil, the amount of $95.00 comes in as $95,00 (with a coma) and that is processed as $9500.00 by Authorize.net.
Code is like this -
string CCAmount = payment.Amount.ToString("# ######.00" );
How do I fix this localization issue.
Side note - Even the date came in as - '18-03-2011 16:23:24' but date is not a problem as I can handle that. I am not sure how to handle the amount part.
Code is like this -
string CCAmount = payment.Amount.ToString("#
How do I fix this localization issue.
Side note - Even the date came in as - '18-03-2011 16:23:24' but date is not a problem as I can handle that. I am not sure how to handle the amount part.
ASKER
I have this in the web.config
<globalization requestEncoding="utf-8" responseEncoding="utf-8" enableClientBasedCulture=" true" culture="auto" uiCulture="auto" />
According to the article above, this should take care of specific culture. Please let me know what else I should try.
<globalization requestEncoding="utf-8" responseEncoding="utf-8" enableClientBasedCulture="
According to the article above, this should take care of specific culture. Please let me know what else I should try.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
carl_tawn,
I changed web.config entry -
<globalization requestEncoding="utf-8" responseEncoding="utf-8" enableClientBasedCulture=" false" culture="en-US" uiCulture="en-US" />
Still it is showing the comma in the currecy. Please see the attached screen shot. I am able to replicate this issue by changing the Language to Spanish(Chile) in the browser. Please let me know what else I can try.
thanks
SM
Without Comma , the currency with English(United States) comes right as shown below
I changed web.config entry -
<globalization requestEncoding="utf-8" responseEncoding="utf-8" enableClientBasedCulture="
Still it is showing the comma in the currecy. Please see the attached screen shot. I am able to replicate this issue by changing the Language to Spanish(Chile) in the browser. Please let me know what else I can try.
thanks
SM
Without Comma , the currency with English(United States) comes right as shown below
ASKER
wdosanjos
Thanks for your suggestion. I will try to do the code change and test it out.
regards
SM
Thanks for your suggestion. I will try to do the code change and test it out.
regards
SM
wdosanjos has given the perfect solution, only change I would suggest is to not to declare an extra variable[and if you are doing such conversion a lot then create a global instance]
string CCAmount = payment.Amount.ToString("#######.00", new System.Globalization.CultureInfo("en-US"));
Regards,
Chinmay.
ASKER
Helped in solving my issue
http://msdn.microsoft.com/en-us/library/bz9tc508(v=VS.80).aspx