From: Ethan A M. <merritt@u.washington.edu> - 2006-07-15 03:50:52
|
On Friday 14 July 2006 05:15 pm, you wrote: > > Do you want to say that the thousand separator is automatically placed > under linux if you set the proper locale? Yes. The separator is taken from the table controlled by LC_NUMERIC. To be explicit: "set decimal locale" causes gnuplot to issue a command setlocale(LC_NUMERIC,""); This has the effect of changing the C library routines *printf() and *scanf() to format numbers using the conventions of the current locale. "set decimal locale 'sl_SI.UTF-8'" does the same except that it uses the conventions of sl_SI.UTF-8 whether or not that is the current locale. What you are calling a "thousand separator" is invoked by the C format character ' I downloaded the Slovenian locale set for testing, and here is what I see: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% gnuplot> set decimal locale decimal_sign in locale is . gnuplot> show locale LC_CTYPE is en_US.UTF-8 LC_TIME is C LC_NUMERIC is en_US.UTF-8 gnuplot> set label 1 sprintf("%'.3f", 12345678.7654321) gnuplot> show label 1 label 1 "12,345,678.765" at (0, 0, 0) left not rotated back nopoint gnuplot> set decimal locale 'sl_SI.UTF-8' decimal_sign in locale is , gnuplot> show locale LC_CTYPE is en_US.UTF-8 LC_TIME is C LC_NUMERIC is sl_SI.UTF-8 gnuplot> set label 1 sprintf("%'.3f", 12345678.7654321) gnuplot> show label 1 label 1 "12345678,765" at (0, 0, 0) left not rotated back nopoint gnuplot> set decimal locale 'de_LU.UTF-8' decimal_sign in locale is , gnuplot> show locale LC_CTYPE is en_US.UTF-8 LC_TIME is C LC_NUMERIC is de_LU.UTF-8 gnuplot> set label 1 sprintf("%'.3f", 12345678.7654321) gnuplot> show label 1 label 1 "12.345.678,765" at (0, 0, 0) left not rotated back nopoint %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Conclusions: 1) set decimal locale "xx_YY.UTF-8" works fine 2) locale "en_US.UTF-8" has a thousands' grouping character: comma 3) locale "de_LU.UTF-8" has a thousands' grouping character: dot 4) locale "sl_SI.UTF-8" does not have a thousands' grouping character. So I think your problem goes a little beyond the scope of gnuplot. If you believe that the sl_SI.UTF-8 locale should contain a grouping character, <period> or anything else, I think you will have to take it up with the approriate standards committee. There is more information here: http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap07.html#tag_07_03 -- Ethan A Merritt Biomolecular Structure Center University of Washington, Seattle 98195-7742 |