[Bug]: toUnit does not round values with custom scales, when using dinero.js rounding functions #296
Closed
2 tasks done
Labels
bug
Something isn't working
Is there an existing issue for this?
Current behavior
The
digits
argument totoUnit
appears to be ignored in v2.0.0-alpha6 when a dinero value with a custom scale is passed: no rounding takes placeHowever, if I import the rounding function
halfUp
from@dinero.js/core
directly, it worksPuzzled as to why this is, as the
dinero.js
package exports the rounding functions directly from@dinero.js/core
anyway! I've never installed any other version of this package, and bothpackage.lock
andnode_modules
show all versions as2.0.0-alpha.6
Expected behavior
The value is rounded to the specified number of digits and scaled appropriately
Steps to reproduce
Failing
Working: "@dinero.js/core" rounding function import
Working: no custom scale
Version
2.0.0-alpha.6
Environment
macOS 11.5, Node 14.16.1, Typescript 4.3.4
Code of Conduct
The text was updated successfully, but these errors were encountered: