dannystommen
October 15th, 2009, 08:48 AM
I have website where users can use the language of their preference.
So far, a user can choose between English and Dutch. When they want to store the numeric value 0.25, they need to enter 0.25 for English and 0,25 for Dutch. So far it works fine.
Now comes the problem. I want to do some clientside calculations base on the user input, just for their clarity. I have 2 input fields (both with decimal values), I want to divide them and show the result in another input field.
Now, the problem is, that when I enter 0,25 (dutch version) in the second field, javascript interprets this as 0. it simply ignores everything behind the ','. Looks like javascript has English as its language.
Is there anyway to set the globalization culture of javascript?
So far, a user can choose between English and Dutch. When they want to store the numeric value 0.25, they need to enter 0.25 for English and 0,25 for Dutch. So far it works fine.
Now comes the problem. I want to do some clientside calculations base on the user input, just for their clarity. I have 2 input fields (both with decimal values), I want to divide them and show the result in another input field.
Now, the problem is, that when I enter 0,25 (dutch version) in the second field, javascript interprets this as 0. it simply ignores everything behind the ','. Looks like javascript has English as its language.
Is there anyway to set the globalization culture of javascript?