Skip to content

Precision based on number of digits #5

@robertvandeneynde

Description

@robertvandeneynde

Hello, currently the precision parameter means the number of digitis after the decimal point but sometimes one want the number of digits to be the precision.

For example, the number 12.345 (1.2345e1) with three digits precision means 12.3 (1.23e1) but the number 1.2345 with three digits precision means 1.23 (1.23e0), one could call it a relative precision. It simple terms, one turns the number in scientific notation then take n digits.

In order to not break with older versions, I suggest to accept a new parameter like digits=3 (mutally exclusive with precision, ie. raises an error if both parameters are given) or def a new function where precision has a diferent meaning.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions