-
Notifications
You must be signed in to change notification settings - Fork 627
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
Modify Rounding methods #220
Conversation
@mwoss Please help me to review this PR when you have time. Thank you so much. |
I apologize @lovung for the late response. I was aware that you have created a PR, but I'm not feeling good lately, so I mostly sleep after my usual 9-7 work :<. I will try to review it today! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had the same thoughts when I was implementing RoundUp/Down, but I decided to go with those two rounding methods and in v2 introduce a single, parametrized Round method that will implement all possible rounding methods.
Anyways, I think adding Floor and Ceil rounding will be valuable and we would eventually add them before reasling v2.
One thing, I would adjust the docs of RoundUp and RooundDown as now they should be something like:
RoundUp rounds the decimal away from zero.
and RoundDown rounds the decimal towards zero.
This is a good idea. Do you want me to help to implement it? |
I was talking about the v2 after fixing all the current issues, so probably after v1.4. About v2 itself I was thinking about the introduction of NaN, Inf values, removing panics, adding Contex, proper precision handling, etc. So there would be much work to do. |
@mwoss I will help if I can. I see some current issues that need to have Context to solve but some are the feature of decimal (don't need to solve). And one more thing, I want to know when will you merge this PR to the |
Fantastic, your help is always welcome. :) |
Why
What I did