-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Description
Some time ago I was reading docs of format specification mini-language and got a bit confused with the description for presentation type f. Because of my misunderstanding, I created #111125 thinking there is an error in docs. There I got an explanation what was actually meant.
Here is the current description of type f:
'f'-- Fixed-point notation. For a given precisionp, formats the number as a decimal number with exactlypdigits following the decimal point. With no precision given, uses a precision of 6 digits after the decimal point for float, and uses a precision large enough to show all coefficient digits for Decimal. If no digits follow the decimal point, the decimal point is also removed unless the#option is used.
The source of my confusion had come from the last sentence. I assumed that it refers to the case with no precision given mentioned in the previous sentence, but it actually refers to the case when p is zero. For comparison, the description of type g at first lists the case when no digits follow the decimal point, and then in a different paragraph lists the case with no precision given (I do not quote the description here because it is too large).
I suggest to rearrange two last sentences in descriptions of types f and e and maybe rephrase some parts. Here are two examples for type f.
Just rearrangement:
'f'-- Fixed-point notation. For a given precisionp, formats the number as a decimal number with exactlypdigits following the decimal point. If no digits follow the decimal point, the decimal point is also removed unless the#option is used. With no precision given, uses a precision of 6 digits after the decimal point for float, and uses a precision large enough to show all coefficient digits for Decimal.
Rearranged sentences with edited 2nd sentence.
'f'-- Fixed-point notation. For a given precisionp, formats the number as a decimal number with exactlypdigits following the decimal point. With a precision of0, the decimal point is removed unless the#option is used. With no precision given, uses a precision of 6 digits after the decimal point for float, and uses a precision large enough to show all coefficient digits for Decimal.