I need to format numbers in my web application depending on user's chosen language, e.g. 1234.56 = "1.234,56" in German. Stuff like sprintf
is currently out of question, since they depend on LC_NUMERIC (which is sensible for desktop applications IMHO) and I'd have to generate every locale on the server, which is a no-go. I would prefer using CLDR's formatting strings, but haven't found an appropriate module. What I'd like to have is a nutshell:
set_locale("de_DE");
print format_number(1234.56);
How does one do that properly?