I am displaying dimensions for ad to be published in newspaper, the height / width seems to use millimetres with incredibly small decimals like x.0002mm, I want numbers to be rounded down (always down, never up) to the nearest whole mm?
For example,
Input -> height: 380.0002mm width: 262.0002mm
expected Output-> height: 380mm width: 262mm
I already tried .toFixed()
, but it is not working for large decimal inputs
For example,
sample Input -> height: 380.1252mm width: 262.6592mm
expected Output-> height: 380.1252mm width: 262.6592mm
I want number to be round down only if decimal number is very small for ex: 380.0002, I want to avoid rounding down if decimal number is greater, for ex: 380.1252