Skip to content

Instantly share code, notes, and snippets.

@sasknot
Created March 23, 2020 14:55
Show Gist options
  • Save sasknot/831e4edf1dd51cd038c8d6c3714c322f to your computer and use it in GitHub Desktop.
Save sasknot/831e4edf1dd51cd038c8d6c3714c322f to your computer and use it in GitHub Desktop.
JS: Remove chars from ending
output.split('').slice(0, -3).join('') + '.000'
Ex:
'1000000'.split('').slice(0, -3).join('') + '.000' // 1000.000
'100000'.split('').slice(0, -3).join('') + '.000' // 100.000
'10000'.split('').slice(0, -3).join('') + '.000' // 10.000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment