truncate 0 at the end in js code example Example: avoiding 0 at front in javascript number.replace(/^0+/, '')