Cornelis de Gier <address@hidden> writes:
>> Beware the decimal-point character: it's locale-dependent.
>
> strtod can take care of that
But strtod is way overkill, and it introduces errors and is slower.
Wouldn't it be better to use the -n option as a model? (Or perhaps
combine with either -n or -g.)
>> Handle both decimal and binary powers of 2, by looking for suffixes
>> like "GB" (decimal) versus "G" not immediately followed by "B"
>> (binary).
>
> df, du and ls don't add a B in their human readable output.
True. I guess we'll need to add an option to sort base-1000 (e.g., df
--si) versus base-1024 (e.g., df --human). Too bad.
> The E doesn't create a problem in this example:...
> Does it give problems in other situations?
Sure: e.g., "0xEE" is ambiguous (assuming C99 strtod, which parses
hexadecimals). But perhaps we can say we don't support that....