<div dir="ltr">Here is output from openSuse 13.1 and Scilab 5.4.1:<br>---------------------------<br>lebevc@linux-xkf0:~> uname -a<br>Linux linux-xkf0.site 3.15.3-1.g42bf625-desktop #1 SMP PREEMPT<br>Wed Jul 2 09:23:08 UTC 2014 (42bf625) x86_64 x86_64 x86_64 GNU/Linux<br>
---------------------------<br>lebevc@linux-xkf0:~> locale<br>LANG=sl_SI.UTF-8<br>LC_CTYPE="sl_SI.UTF-8"<br>LC_NUMERIC="sl_SI.UTF-8"<br>LC_TIME="sl_SI.UTF-8"<br>LC_COLLATE="sl_SI.UTF-8"<br>
LC_MONETARY="sl_SI.UTF-8"<br>LC_MESSAGES="sl_SI.UTF-8"<br>LC_PAPER="sl_SI.UTF-8"<br>LC_NAME="sl_SI.UTF-8"<br>LC_ADDRESS="sl_SI.UTF-8"<br>LC_TELEPHONE="sl_SI.UTF-8"<br>
LC_MEASUREMENT="sl_SI.UTF-8"<br>LC_IDENTIFICATION="sl_SI.UTF-8"<br>LC_ALL=<br>---------------------------<br>lebevc@linux-xkf0:~> printf "%0.2f\n" 3.1416<br>bash: printf: 3.1416: invalid number<br>
0,00<br>lebevc@linux-xkf0:~> printf "%0.2f\n" 3,1416<br>3,14<br><br>//-----Scilab---------------------<br><br>-->ver <br>Scilab Version: 5.4.1.1364497457 <br><br>-->x = 0.12345<br> x = <br> 0.12345 <br>
<br>-->xstr = msprintf("%0.2f", x)<br> xstr = <br> 0.12 <br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-07-29 22:41 GMT+02:00 Stefan Du Rietz <span dir="ltr"><<a href="mailto:sdr@durietz.se" target="_blank">sdr@durietz.se</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Leon, Can you please try it with Scilab 5.4.1 under openSUSE? And can you show its Bash output from<br>
$ locale<br>
<br>
When I was running Scilab 5.4.1 under Xubuntu 12.04, printf worked OK, but also in Bash. So the question is: Why do you now get different results in Scilab and Bash?<br>
<br>
And *the important point*: Why should a mathematics program handle inputs differently from outputs?<br>
<br>
If one should handle decimal separators differently depending on the local language, it should be done consistently (as in Bash, even if I don't like it)!<br>
<br>
One could of course have special functions or arguments to present numbers in specific local formats.<span class="HOEnZb"><font color="#888888"><br>
<br>
Stefan</font></span><div><div class="h5"><br>
<br>
<br>
On 2014-07-29 19:41, Leon Bevc wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
Strange...<br>
<br>
In this case I got the same result as you on Xubuntu and openSUSE:<br>
<br>
[ xUbuntu 14.04.1 - 32bit / Scilab 5.5.0 / LANG=sl_SI.UTF-8 ]<br>
lebevc@book-PC:~$ printf "%0.2f\n" 3.1416<br>
bash: printf: 3.1416: neveljavno število<br>
0,00<br>
lebevc@book-PC:~$ printf "%0.2f\n" 3,1416<br>
3,14<br>
<br>
------------------------------<u></u>------------------------------<u></u>----------<br>
[ openSUSE 13.1-64bit ; Scilab 5.4.1]<br>
lebevc@linux-xkf0:~> printf "%0.2f\n" 3.1416<br>
bash: printf: 3.1416: invalid number<br>
0,00<br>
lebevc@linux-xkf0:~> printf "%0.2f\n" 3,1416<br>
3,14<br>
<br>
-->x = 0.6231166;<br>
-->xstr = msprintf("%0.2f", x)<br>
xstr =<br>
0.62<br>
<br>
<br></div></div><div class="">
______________________________<u></u>_________________<br>
users mailing list<br>
<a href="mailto:users@lists.scilab.org" target="_blank">users@lists.scilab.org</a><br>
<a href="http://lists.scilab.org/mailman/listinfo/users" target="_blank">http://lists.scilab.org/<u></u>mailman/listinfo/users</a><br>
<br>
</div></blockquote><div class="HOEnZb"><div class="h5">
<br>
<br>
______________________________<u></u>_________________<br>
users mailing list<br>
<a href="mailto:users@lists.scilab.org" target="_blank">users@lists.scilab.org</a><br>
<a href="http://lists.scilab.org/mailman/listinfo/users" target="_blank">http://lists.scilab.org/<u></u>mailman/listinfo/users</a><br>
</div></div></blockquote></div><br></div>