This commit is contained in:
MICHAEL JACKSON
2017-11-25 13:25:01 -08:00
parent f3974b5e2d
commit 3a309241da
64 changed files with 635 additions and 801 deletions

View File

@ -1,10 +1,10 @@
const formatNumber = n => {
const digits = String(n).split('')
const digits = String(n).split("")
const groups = []
while (digits.length) groups.unshift(digits.splice(-3).join(''))
while (digits.length) groups.unshift(digits.splice(-3).join(""))
return groups.join(',')
return groups.join(",")
}
export default formatNumber