Decimal separator

blind Pete 0123peter at gmail.com
Tue Dec 24 00:53:02 UTC 2013


Johnny Rosenberg wrote:

> In a terminal (bash), is there something that I can type that gives me the
> current decimal separator?
> 
> For instance, if Swedish locale:
> 
> $ echo "Current decimal separator: ${SomeVariable}"
> Current decimal separator: ,
> $
> 
> 
> Johnny Rosenberg

Current for what?  You could have different separators used 
for "ls" and "df".  

You could grep various "locale" files or pipe the output of "env" 
through "grep", but some variable that you want might not be defined.  

I have this; 
psd at PPlive:~$ env | grep BLOCK
BLOCK_SIZE='1
DF_BLOCK_SIZE='M
psd at PPlive:~$ df .
Filesystem     1M-blocks    Used Available Use% Mounted on
/dev/sda3        37,420M 30,280M    5,234M  86% /home
psd at PPlive:~$

That translates as, most commands have a comma as a thousands 
separator and units of one byte, but "df" uses units of MB.

-- 
blind Pete
Sig goes here...  





More information about the ubuntu-users mailing list