Skip to content

Add option to preserve trailing zeros in 'toDecimal' output #37

@austindd

Description

@austindd

I would love to see an optional argument for toDecimal to preserve the exact number of digits specified in the digits argument by appending trailing zeros to the end of the output string. The current implementation will only enforce that the number of digits does not exceed the specified amount. Trailing zeros are essentially omitted.

This sort of thing probably doesn't matter when the result string is meant to be parsed back into a number. But it does occasionally matter for serialization and storage, especially when the exact level of precision must be known & enforced.

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