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

Finish implementation of CLDR number formatting #3

Open
5 of 10 tasks
syeopite opened this issue Sep 1, 2021 · 2 comments
Open
5 of 10 tasks

Finish implementation of CLDR number formatting #3

syeopite opened this issue Sep 1, 2021 · 2 comments
Milestone

Comments

@syeopite
Copy link
Owner

syeopite commented Sep 1, 2021

The basic infrastructure for implementing number formatting was introduced in Lens with commit 5997047. Since then, almost all features needed to format a number has been added. In fact, the formatter is actually present and working:

In commit 7e2d9f1 of master, this code produces the expected output of 10,00,00,000.124

rules, metadata = CLDR::Numbers::PatternParser.new("#,##0.##").parse
formatter = CLDR::Numbers::PatternFormatter(CLDR::Languages::EN).new(rules, metadata)

formatter.format(1000.129) # => 1,000.13
formatter.format(-1000.129) # => -1,000.13

However, despite all this there's still quite a few crucial features missing.

  • Explicit plus signs and negative patterns
  • Prefixes
  • Suffixes
  • Minimum grouping digits
  • Significant digits
  • Scientific notations
  • Rounding
  • Padding
  • Currency symbols
  • Fractional grouping

A better public API should then be constructed before we can push it out to version 0.2.

@syeopite syeopite added this to the 0.2.0 milestone Sep 1, 2021
@syeopite
Copy link
Owner Author

Implemented parsing for significant figures, padding and fractional grouping in commit 46df2ab.

@syeopite
Copy link
Owner Author

Implemented parsing for subpattern and explicit plus-minus signs with commit ba67656

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant