Closed lordofthebrain closed 1 year ago
This is intended behavior. Currency follows a round half up methodology so half values will always round up. If you want a different formatted value, you could potentially pass in a custom format function to do so.
Here some examples:
currency(1.25, { precision: 1 }); // => "1.3" correct
currency(-1.25, { precision: 1 }); // => "-1.2" not correct should be "-1.3"
currency(-1.251, { precision: 1 }); // => "-1.3" correct
currency(-1.26, { precision: 1 }); // => "-1.3" correct
I do not know why the one case does not work. Please fix.