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

Support providing numbers with selected precision #34

Open
zbraniecki opened this issue May 6, 2020 · 0 comments
Open

Support providing numbers with selected precision #34

zbraniecki opened this issue May 6, 2020 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@zbraniecki
Copy link
Owner

Thanks, I can confirm that my previous test no longer panics when using the updated pluralrules.

The thing that struck me as potentially difficult about starting with a float is that when the decimal places haven't been rigidly set by the caller, you'd need to determine how many decimal places are appropriate, and it seems like you'd end up reimplementing the logic in format that does so

assert_eq!(&format!("{}", 3.020000000000000007), "3.02");

The logic looks to be non-trivial:

https://github.com/rust-lang/rust/blob/master/src/libcore/num/flt2dec/mod.rs

Originally posted by @dae in projectfluent/fluent-rs#162 (comment)

@zbraniecki zbraniecki added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels May 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant