MikeMcl/decimal.js

Convert Decimaljs to fixed string without trailing zeros

MylesWardell opened this issue · 1 comments

I would like to avoid converting my numbers to JS numbers ever but I don't want to add regex to every request where the user sees the number to clear trailing zeros. Could we add a round option or new chain option that converts the decimal to string without trailing zeros?

Example of what I am showing the user. I am not a fan of any of these solutions https://stackoverflow.com/questions/3612744/remove-insignificant-trailing-zeros-from-a-number

.toDecimalPlaces().toString() Just saw the previously closed issue. Closing 👍