Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. const formatBigIntNum = (value) => {
  2. if (isNaN(value)) return value
  3. const isInteger = Math.floor(value) === value
  4. return isInteger ?
  5. String(value).replace(/(?=(\B\d{3})+$)/g, ',') :
  6. value
  7. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement