aboutsummaryrefslogtreecommitdiff
path: root/util/helperFunctions.js
blob: 2bea5d0841ece615981f21f2b420fdd1b9e9c891 (plain)
1
2
3
4
5
6
7
8
9
10
/*
Created 11/11/2022 by Ninjune.
*/
export function addCommas(num) {
    try {
        return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
    } catch (error) {
        return 0;
    }
}// credit to senither for the regex, just don't care to make my own lol