Example
65.110 //result = 65.11
65.111 //result = 65.111
65.100 //result = 65.10
65.000 //result = 65.00
i tried the below one but it's not working
round(3).replace(/(\.0+|0+)$/, '');
65.110 //result = 65.11
65.111 //result = 65.111
65.100 //result = 65.10
65.000 //result = 65.00
i tried the below one but it's not working
round(3).replace(/(\.0+|0+)$/, '');
You could just replace the last zero, if exist.
const
format = number => number.toFixed(3).replace(/0$/, '');
console.log([65.110, 65.111, 65.100, 65.000].map(format));