Prettify everything
This commit is contained in:
@ -1,10 +1,10 @@
|
||||
const formatNumber = n => {
|
||||
const digits = String(n).split("")
|
||||
const groups = []
|
||||
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
|
||||
export default formatNumber;
|
||||
|
Reference in New Issue
Block a user