We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
round_to_digit
Float
Add round_to_digit method to Float trait.
let full_float = 12.34567; let rounded_float = full_float.round_to_digit(2); assert_eq!(rounded_float, 12.35);
The text was updated successfully, but these errors were encountered:
We can only add this if there's a generic implementation. Have you attempted that?
Sorry, something went wrong.
yes, I created a crate for this: https://crates.io/crates/round_float
The code is here: https://github.com/amab8901/round_float/blob/master/src/round_float.rs
No branches or pull requests
Add
round_to_digit
method toFloat
trait.Example usage
The text was updated successfully, but these errors were encountered: