sprintf.js icon indicating copy to clipboard operation
sprintf.js copied to clipboard

localization, internationalization decimal-separator

Open inox99 opened this issue 5 years ago • 1 comments

is it possible to setup sprintf to format due to a language-specifier (e.g."fr", "es", "de") to have the output accordingly? So: console.log(sprintf("%0.2f", 1.23456789)); to print 1.23 for "en" 1,23 for "de" either by choosing a language-specifier or by setting the decimal-separator-character?

Edgar

inox99 avatar Mar 25 '20 15:03 inox99

I also need this. As far as I can see, this is currently not possible. As a workaround, I'm replacing a '.' with a ',' after formatting (I'm only using the library for very simple use cases).

vmsh0 avatar Feb 02 '21 15:02 vmsh0