Utils: removeTrailingZeros - handle .0* decimal part (i.e. 1.00000)

This commit is contained in:
xiphon 2020-12-10 22:58:35 +00:00
parent ea1fee2f5f
commit 841d0e01dc

View file

@ -113,5 +113,5 @@ function capitalize(s){
} }
function removeTrailingZeros(value) { function removeTrailingZeros(value) {
return (value + '').replace(/(\.\d*[1-9])0+$/, '$1'); return (value + '').replace(/\.?0*$/, '');
} }