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

too rubbish to called rust decimal #629

Closed
zzy444626905 opened this issue Dec 21, 2023 · 3 comments · Fixed by #630
Closed

too rubbish to called rust decimal #629

zzy444626905 opened this issue Dec 21, 2023 · 3 comments · Fixed by #630

Comments

@zzy444626905
Copy link

···
let result = Decimal::from_str("111111111111111111111111111111111111111111111111111111111111111111").unwrap();
println!("{}", result);
···

···
ErrorString("Invalid decimal: overflow from too many digits")
···

@schungx
Copy link
Contributor

schungx commented Dec 21, 2023

Not necessary to be rude. You don't have to use it if it doesn't suit you.

@Tony-Samuels
Copy link
Collaborator

Tony-Samuels commented Dec 21, 2023

You might be interested in BigDecimal if you want arbitrarily sized decimal numbers. This crate is for constant size, no allocation decimals; which does apply a limit to the size of numbers that can be handled.

@paupino
Copy link
Owner

paupino commented Dec 22, 2023

Thanks folks! I've used this as an opportunity to update the readme to add a section calling out when this library may not be suitable and to highlight alternatives. Feel free to take a look and as always if something looks off or could be explained better then let me know (or open a PR).

In the meantime, I'll close this issue since there isn't anything actionable (other than readme clarification) that can be done.

@paupino paupino closed this as completed Dec 22, 2023
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

Successfully merging a pull request may close this issue.

4 participants