-
Notifications
You must be signed in to change notification settings - Fork 186
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
Guidance for a Rust newbie - Decimal constant? #400
Comments
I would second this, as it is usually quite convenient to have the following constants, in addition to ZERO, ONE, TWO and PI: NEGATIVE_ONE (useful as a step) |
It is currently possible to create a constant const DECIMAL_0_001: Decimal = Decimal::from_parts(1, 0, 0, false, 3); Once rust-lang/rust#51999 is stabilized, it will be possible to write const PI: Decimal = Decimal::try_from_i128_with_scale(3141_i128, 3).unwrap(); |
Yes, but in actual usage, it is simpler to just do |
Given:
Is there a way to have a Decimal::ONE_HUNDRED constant?
The text was updated successfully, but these errors were encountered: