bug-apl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: printf issue with thousands separator


From: Dr . Jürgen Sauermann
Subject: Re: printf issue with thousands separator
Date: Wed, 6 Jul 2022 18:29:34 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

Hi Blake,

in theory: yes. The problem is that the behaviour of locales can be quite
unpredictable and therefore allowing to change it means that the underlying
glibc may produce results that are no easy to foresee. The current problem
(the thousands' separator) is a good example for this.

For most locales (and also for APL) we have:

1. the thousands' separator is inserted after every 3 digits, and
2. the thousands separator is a single character

If we would care for locales defined by the user, e.g. in preferences
or via locale-related environment variables, then there would most likely
be a mismatch between ⎕FC (which controls the thousands' separator
in APL) and the locale (which normally controls the thousands' separator
in ⎕FIO.sprintf). IMHO this could make matters a lot more complicated
without any real advantages for the user.

The current solution is more locale-agnostic and ⎕FIO.sprintf uses
⎕FC instead of the locale to determine the thousands' separator.

Best Regards,
Jürgen


On 7/6/22 4:32 PM, Blake McBride wrote:
On Wed, Jul 6, 2022 at 7:07 AM Dr. Jürgen Sauermann <mail@jürgen-sauermann.de <mailto:mail@j%C3%BCrgen-sauermann.de>> wrote:

    [...]
    The problem is, though, that calling setlocale()
    in GNU APL is problematic since I cannot possibly know beforehand
    what the locale of the user will be.


Can't this be set in ~/.gnu-apl/preferences  ?

Blake McBride





reply via email to

[Prev in Thread] Current Thread [Next in Thread]