[Top][All Lists]

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

Re: strfmon in the C locale

From: Bruno Haible
Subject: Re: strfmon in the C locale
Date: Sat, 23 Sep 2017 18:01:39 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-93-generic; KDE/5.18.0; x86_64; ; )

I wrote:
> The result I would have expected is therefore:
> currency = ||
> positive sign = ||
> negative sign = ||
> strfmon result for positive value = |  123|
> strfmon result for negative value = |  123|

AIX indeed produces this output.

AIX additionally, for the call
  strfmon (buf, sizeof (buf), "%.2n", 123.5);
produces the result

So, this implementation of strfmon is very standards-compliant.
But without a distinction between positive and negative values,
and without a visible decimal separator, this behaviour is useless,
or even dangerous (if a programmer was not aware of this behaviour
and has not worked around it).

I would vote for removing strfmon() and strfmon_l() from POSIX.


reply via email to

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