On 07/08/2018 01:26 PM, Per Jessen wrote:
Carlos E. R. wrote:
To tell the truth, as a programmer I would not know how to write numbers using the locale.
man printf :-)
"For some numeric conversions a radix character (`decimal point') or thousands' grouping character is used. "
Example:
int main( int argc, char **argv ) { setlocale( LC_NUMERIC, getenv( "KLOP99" ) ); printf("%'.2f", 1234567.89); }
for i in nl_NL.utf8 da_DK.utf8 de_CH.utf8 en_GB.utf8 do KLOP99=$i ./k done
1234567,89 1.234.567,89 1'234'567.89 1,234,567.89
Normally a programmer just needs to be aware that a locale will be applied on input and output, but she should not need to do anything extra.
Or setting the wanted LC_NUMERIC for the command of choice in the shell: LC_NUMERIC=da_DK.utf8 numfmt ... Have a nice day, Berny -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org