I am using php. I am trying to format a number based on the user culture. what I ideally would love would be a function to which I could give the culture and the number as parameters and it would automatically format the number based on the culture but I have not found anything like that.
So I tried using setlocale(LC_NUMERIC, myCulture), then call localeconv() to know which decimal separator and thousands separator etc to use the number_format function. I put results on variables, and they are all the same! i.e. I made:
setlocale(LC_NUMERIC, "en-US");
$result1 = localeconv();
setlocale(LC_NUMERIC, "fr-FR");
$result2 = localeconv();
$result1 and $result2 are the exact same things! What am I doing wrong? any idea? Thank you for your help,
Martin