Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sffc opened this issue Oct 30, 2023 · 0 comments
Open

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

sffc opened this issue Oct 30, 2023 · 0 comments
Labels
C-numbers Component: Numbers, units, currencies T-bug Type: Bad behavior, security, privacy U-ecma402 User: ECMA-402 compatibility

Comments

@sffc
Copy link
Member

sffc commented Oct 30, 2023

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<'_> {

@sffc sffc added T-bug Type: Bad behavior, security, privacy C-numbers Component: Numbers, units, currencies U-ecma402 User: ECMA-402 compatibility labels Oct 30, 2023
@sffc sffc added this to the 2.x Priority ⟨P2⟩ milestone Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-numbers Component: Numbers, units, currencies T-bug Type: Bad behavior, security, privacy U-ecma402 User: ECMA-402 compatibility
Projects
None yet
Development

No branches or pull requests

1 participant