Jimphot0
asked on
Can Javascript change a currency format based on users Windows Location settings?
Hello - I have tried to find a solution for this problem in the Lotus Notes areas but to no avail.
So here goes: I have a web form from Notes that sends a USD currency format of $18.11 to a shopping cart and for some European customers they are getting charged $18.00 - After a phone call to a user and walking through the website, I see that as soon as they open the web page, the total is already showing as
"18,00 Euros" - My question is: Can javascript detect the user's Regional settings and reformat the value coming from the currency field to the proper format based on Region?
Thanks in advance to anyone who helps.
So here goes: I have a web form from Notes that sends a USD currency format of $18.11 to a shopping cart and for some European customers they are getting charged $18.00 - After a phone call to a user and walking through the website, I see that as soon as they open the web page, the total is already showing as
"18,00 Euros" - My question is: Can javascript detect the user's Regional settings and reformat the value coming from the currency field to the proper format based on Region?
Thanks in advance to anyone who helps.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks It does make sense expect that we are passing a text string of 18.11 now.The shopping cart takes the value that we pass, but it seems that the user's settings change the format from the 18.11 to 18.00 before forwarding to the credit card processor. It looks like I have to have the Notes server check what kind of user we are dealing with and format the outgoing to him in the format they expect.
Your welcome! Let me know if I can help with anything else for this question or if you have a question about closing this. It is always best to confirm or rely on the server script. Javascript just isn't reliable, no matter how great it is. :)
bol
bol
I'm glad I could help. Thanks for the grade, the points and the fun question.
bol
bol
First of all, Javascript cannot detect your local PC settings directly, although there is a trick you can do to get something close to it. Javascript can only detect settings in the browser so you can query the browser language settings. From that you can determine what currency to use.
See here for more info:
http://www.builderau.com.au/program/web/soa/Detect-foreign-language-support-using-JavaScript/0,339024632,320278495,00.htm
Hope that helps.
Lee