I have noticed a strange seq
behavior on one of my computers (Ubuntu LTS 14.04): instead of using points as decimal separator it is using commas:
seq 0. 0.1 0.2
0,0
0,1
0,2
The same version of seq (8.21) on my other PC gives the normal points (also same Ubuntu version). The strangest thing is that I am observing the same ill behavior on a remote machine when I ssh into it from the first machine. Even a bash script submitted from the conflictive machine to a job scheduler (slurm) on the remote machine is having this problem. I am very confused. Why (and how!) is this happening?
Great Britain and the United States are two of the few places in the world that use a period to indicate the decimal place. Many other countries use a comma instead. The decimal separator is also called the radix character.
Click File > Options. On the Advanced tab, under Editing options, clear the Use system separators check box.
If you want to allow user to input comma as decimal separator, you will need to apply locale to input stream too: std::cin. imbue(std::locale( "se-SE" ));
It's likely the LANG
variable or some other locale-specific variable. On a computer where seq
behaves "normally" try:
$ LANG=fr_FR seq 0. 0.1 0.2
0,0
0,1
0,2
$ LANG=en_US seq 0. 0.1 0.2
0.0
0.1
0.2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With