Subject: Re: bug#47302: 27.1; calc math-format-number formatting for floats without decimals is unusual

From: Mattias Engdegård <[email-masked]>
Date: Thu, 22 Apr 2021 15:44:07 +0200

21 apr. 2021 kl. 17.16 skrev Stefan Kangas <[email-masked]>:
> 
> Jelle Licht <[email-masked]> writes:

>> (calc-eval "123.0") ; => "123."
>> (calc-eval "0.0") ; => "0."
>> 
>> I would expect this output to be either "123.0" or "123" and "0.0" or
>> "0" respectively.

Jelle, thanks for the report!

Calc distinguishes integers from floating-point numbers by the presence of a decimal point, so removing it is probably not a good idea. The lack of a trailing 0 after the decimal point is clearly intended but mainly a cosmetic issue; it's uncommon in hand-writing but not in computerese.

We could put a 0 after the decimal point but not doing so saves some space in the often narrow Calc windows. I'd suggest leaving it as it is. The notation is distinctive enough that there is no serious risk of misunderstanding.

If you disagree, do say.