how to global setting for decimal number separator comma ?

635 views
Skip to first unread message

mitab

unread,
Jan 9, 2015, 4:15:03 AM1/9/15
to multisoft...@googlegroups.com
locale set cs_CZ
for example comman line
printf "%f" 3,1415
3,141500

Paul

unread,
Jan 9, 2015, 6:35:10 AM1/9/15
to
This is FlagShip users group, your request instead relates to Linux bash command line. Therefore in short: the deci point in bash depends on environment variable LANG and LC_NUMERIC, for example

  echo $LANG                                  ## de_DE.utf8
  printf "%f\n" 3,1415                        ## 3,141500
  export LC_NUMERIC=C ; printf "%f\n" 3.1415  ## 3.141500

In FlagShip, the deci point (dot or comma) is independent on the current locale setting, e.g.

  pi := 3.14
  @ 1,1 say pi                 // 3.14
  @ 2,1 say pi pict "@E"       // 3,14
  ? pi                         // 3.14
  ? transform(pi, "@E")        // 3,14
 

Further details are in the FlagShip manual section CMD @..SAY, @..GET and FUN.Transform(). To specify the displayed number of decimal digits, see CMD.SET FIXED and SET DECIMALS.

Hope this helps you.
Paul
Reply all
Reply to author
Forward
0 new messages