php-bignumbers icon indicating copy to clipboard operation
php-bignumbers copied to clipboard

Round half even and odd

Open josecelano opened this issue 9 years ago • 4 comments

It would be nice to have the same round modes than round() PHP function:

http://php.net/manual/en/function.round.php

josecelano avatar Apr 11 '15 09:04 josecelano

Buenas @josecelano ,

yep, it's an interesting idea :) . I'm working on a big refactoring of this library (currently I'm on the design phase) and I haven't many time for this feature, but if you know how to implement it, I invite you to make a pull request.

Thanks for the idea.

castarco avatar Apr 11 '15 10:04 castarco

I do not know how to do it (I have not thougth about it). I am using this library to implement a BigMoney class: https://github.com/mathiasverraes/money/issues/7 I am going to finish my implementation and I will try to find a solution.

josecelano avatar Apr 11 '15 10:04 josecelano

I have found this library: https://github.com/keiosweb/moneyright/blob/master/src/Math.php

josecelano avatar Apr 11 '15 14:04 josecelano

@josecelano thx, I'll take a look.

castarco avatar Apr 11 '15 16:04 castarco