On Mon, Jun 17, 2024 at 3:48 AM Léa Gris <lea.g...@noiraude.net> wrote: > > Le 17/06/2024 à 09:17, Koichi Murase écrivait : > > declare -i numvar=${localeFormatted/[!0-9]/.} > > This would break with negative numbers. > > I know no other radix separator than comma or dot. If there are other > radix to replace, it can be listed in a character class. > > Lets say there are locales that uses , ; or : > > declare -i numvar=${localeFormatted/[,;:]/.}
Do different locales use different characters in the place of 'e' in "[-]d.ddde±dd" and 'p' in "[-]0xh.hhhhp±d"? (These pulled out of 'man 3p fprintf' - the 'e' and 'a' conversion specifiers.) If floating point math support is added to bash, I would expect it to be able to handle floating point literals in these forms as well. I'm assuming that floating point literals can be specified in C source code in these forms. Another reason why this is more work than it looks like from the surface.