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

Add round_to_digit method to Float trait. #317

Open
amab8901 opened this issue Apr 10, 2024 · 2 comments
Open

Add round_to_digit method to Float trait. #317

amab8901 opened this issue Apr 10, 2024 · 2 comments

Comments

@amab8901
Copy link

Add round_to_digit method to Float trait.

Example usage

let full_float = 12.34567;
let rounded_float = full_float.round_to_digit(2);
assert_eq!(rounded_float, 12.35);
@cuviper
Copy link
Member

cuviper commented May 3, 2024

We can only add this if there's a generic implementation. Have you attempted that?

@amab8901
Copy link
Author

amab8901 commented May 4, 2024

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

No branches or pull requests

2 participants