schowdhuri / round-half-even

Banker's rounding utility

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

numberOfDecimals not working correctly

humpedli opened this issue · comments

roundHalfEven(-104.8936316, 7) // returns: -104.89
roundHalfEven(-83.0715644, 7) // returns: -83.07

I expected the same number as return value.

commented

@humpedli thanks for reporting this issue! I had missed numDecimals in the recursive call for negative numbers: 4bbb4ec#diff-bfe9874d239014961b1ae4e89875a6155667db834a410aaaa2ebe3cf89820556R19

Published a fix :)