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

Introduce trunc_with_scale #576

Merged
merged 1 commit into from
Mar 7, 2023
Merged

Introduce trunc_with_scale #576

merged 1 commit into from
Mar 7, 2023

Conversation

c410-f3r
Copy link
Contributor

Feel free to close this PR if such thing is not desired.

It took me quite some time to figure out how to truncate the fractional part to a certain scale so I thought that other people could also benefit from this method.
The internal implementation is shamelessly re-using round_dp_with_strategy but in the future a more efficient code can be elaborated.

@c410-f3r c410-f3r force-pushed the master branch 2 times, most recently from 8ae854a to a71ce66 Compare February 28, 2023 13:20
@paupino
Copy link
Owner

paupino commented Mar 7, 2023

Sorry for the delay - been very much busy!
Happy to introduce this function if it makes discoverability easier. What I may do however is take what you have and update it so that this and trunc uses the same code path - it's a very minor change to be able to do so.

@paupino paupino merged commit e4b5c51 into paupino:master Mar 7, 2023
@c410-f3r
Copy link
Contributor Author

c410-f3r commented Mar 7, 2023

Nice! Thank you very much @paupino

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 this pull request may close these issues.

None yet

2 participants