I have a script that scans Web pages to applies formatting to numbers. For example if it finds a number bigger than 50000 it applies a red background.
The script works fine in languages that use the dot as decimal separator (for example English 12,345.67 will be interpreted as 12345.67), but fails in languages that use the comma as decimal separator (French 1,234 will be interpreted as 1234 instead of 1.234).
My question: is there a way to detect the Web page locale, and interpret the number accordingly?