SHARE
TWEET

Untitled

a guest Oct 23rd, 2019 88 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top