-
Notifications
You must be signed in to change notification settings - Fork 9
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 new option: round_option (floor/ceil/normal) #9
Comments
Yeah I think this would be fine, please make a pull request here for it. |
I have since writing the patch worked with this and after a while i figured out i have a "missunterstanding" of rounding :-/ Rounding should only change the behavior of 0.5 . My intension is a floor/ceil/round with precision ... so i can decide that 0.32 will change to 0.4 or 0.3 ... That is what my patch do, but i guess the naming is bad ... that is not really a roundoption, it is a floor/ceil/round with precision option. Please check my submitted tests and feel free to rename roundoption to something better. I use this with Template::Toolkit to always floor the results of some money calculations in €. |
Come to think, there's two more possibilities as well - absolute value based floor/ceil. It would be the same as regular floor/ceil for positive numbers, but the opposite for negative ones. I don't know if anyone would want that though .... |
- floor(), abs_floor(), ceil() and abs_ceil() added - roundoption integrated as fifth argument to format_number() - see billward#9
ok, i think the logic is ready, there is only a little lack of documentation :-/ number_format() fifth argument must be documented perhaps constants for roundoption values would be better also i have to switch two rows in format_number() (first round(), than use abs() ; all test pass, i guess the order was not important) Please have a look and guide me with the documentation (or better: add them ;) ) |
- see billward#9
- see billward#9
- to export all constants use :constants or :all - see billward#9
- Documentation changes - explain undef as argument to round() and format_number() - see billward#9
Hello,
is this feature desired?
https://rt.cpan.org/Public/Bug/Display.html?id=75657
I can make a valid push request against 1.75.
The text was updated successfully, but these errors were encountered: