sindresorhus/round-to

No way to round to and keep decimal places #17

corbmanj posted onGitHub

I would like an option to roundTo and enforce that number of decimal places. For instance roundTo(1.001, 2) returns 1 rather than 1.00. I understand that this representation would have to be a string in javascript, but that would be a nice option.


roundTo(1.001, 2).toFixed(2)

posted by sindresorhus about 5 years ago

Fund this Issue

$0.00
Funded

Pull requests