Skip to content

Commit

Permalink
Utils: removeTrailingZeros - handle .0* decimal part (i.e. 1.00000)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiphon committed Dec 10, 2020
1 parent ea1fee2 commit 841d0e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion js/Utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,5 @@ function capitalize(s){
}

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

0 comments on commit 841d0e0

Please sign in to comment.