Skip to content

Make description of presentation types f and e in format spec more clear #123133

Closed
@Prometheus3375

Description

@Prometheus3375

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 precision p, formats the number as a decimal number with exactly p digits 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 precision p, formats the number as a decimal number with exactly p digits 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 precision p, formats the number as a decimal number with exactly p digits following the decimal point. With a precision of 0, 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.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dir

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions