Hot answers tagged

43

Ask locale: locale decimal_point This will output the decimal point using the current locale settings. If you need the thousands separator: locale thousands_sep


6

If that's a zsh shell script, you can use the $langinfo special associative array in the zsh/langinfo module: zmodload zsh/langinfo radix=$langinfo[RADIXCHAR] (that maps to the standard nl_langinfo(RADIXCHAR), see man nl_langinfo on your system for details; $langinfo[THOUSEP] for the thousand separator). In a bash script (would also work in zsh), you ...


2

As suggested by jamespharvey20 on IRC, I just changed LC_TIME to another locale. I set it in /etc/locale.conf: $ cat /etc/locale.conf LANG=en_US.UTF-8 LC_TIME=en_GB I also exported this value of LC_TIME in my shell profile, to avoid having to restart (I couldn't figure out how to get Systemd to reread the locale.conf). This seems a bit hacky but I think it'...


Only top voted, non community-wiki answers of a minimum length are eligible