Pádraig Brady <[email protected]> writes:
> On 08/10/2025 07:55, Jim Meyering wrote:
>> On Wed, Oct 8, 2025 at 12:37 AM Pádraig Brady <[email protected]> wrote:
>> ...
>>> Yes I think this feature is useful. I think the standards
>>> also mention a preference to avoid line breaks between numbers,
>>> and so NBSP might be good to support as an option also.
>>>
>>> So we could have an optional argument like: --suffix-space[=CHAR]
>>>
>>> Supporting:
>>>
>>> --suffix-space # ASCII space
>>> --suffix-space=$'\u00A0' # Non breaking space
>>> --suffix-space=$'\u202F' # Narrow NBSP
>> Maybe --suffix-separator= or even just --separator= ?
>
> Yes that is more accurate.
>
> BTW, originally I envisaged that --format would be central to numfmt,
> and you would get the flexibility through its arguments.
>
> However currently we take anything after the "%f" as _after_ the suffix:
>
> $ printf '123412G 1234123G\n' |
> numfmt --from=auto --to=si --field=1,2 --format=$'[%f\u00A0]'
> [124T ] [ 1.3P ]
>
> Given any string is accepted after the %f directive,
> I'm not sure it's practical to change that now.
> So --suffix-separator seems like the best option.
I find --separator to be easier to type than the other options.
Can we just have it behave like 'seq --separator' does?
$ seq --separator=abc 3
1abc2abc3
I don't see why you would want to use anything other than spaces, but I
also don't see much point in limiting the separator to only spaces.
Collin