diff options
author | Ninjune x <enderknight537@gmail.com> | 2022-11-17 16:56:06 -0600 |
---|---|---|
committer | Ninjune x <enderknight537@gmail.com> | 2022-11-17 16:56:06 -0600 |
commit | fb63481d2c5b7b468df6c5ebdee30178bc9155f5 (patch) | |
tree | 3ec467f8acb9594c7b5547426a3b640856dc7e37 /util/helperFunctions.js | |
parent | 9085ac77ce364572b14f132b64ead5cde2194607 (diff) | |
download | coleweight-fb63481d2c5b7b468df6c5ebdee30178bc9155f5.tar.gz coleweight-fb63481d2c5b7b468df6c5ebdee30178bc9155f5.tar.bz2 coleweight-fb63481d2c5b7b468df6c5ebdee30178bc9155f5.zip |
1.6.0 Changelog in releasesv1.6.1
Diffstat (limited to 'util/helperFunctions.js')
-rw-r--r-- | util/helperFunctions.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/util/helperFunctions.js b/util/helperFunctions.js new file mode 100644 index 0000000..2bea5d0 --- /dev/null +++ b/util/helperFunctions.js @@ -0,0 +1,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
\ No newline at end of file |