Skip to content

Compact decimal should retain 2 significant digits for small numbers #4241

Open
@sffc

Description

@sffc

This was found from @sven-oly's conformance test suite.

If the input to CompactDecimalFormatter::format_fixed_decimal is a fractional number less than 1, we should retain 2 significant digits according to the ECMA-402 specification (citation available upon request). This is highlighted in the conformance test suite. Currently we are just rounding off the trailing fractional digits completely.

pub fn format_fixed_decimal(&self, value: FixedDecimal) -> FormattedCompactDecimal<'_> {

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-numbersComponent: Numbers, units, currenciesT-bugType: Bad behavior, security, privacyU-ecma402User: ECMA-402 compatibility

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions