From fb63481d2c5b7b468df6c5ebdee30178bc9155f5 Mon Sep 17 00:00:00 2001 From: Ninjune x Date: Thu, 17 Nov 2022 16:56:06 -0600 Subject: 1.6.0 Changelog in releases --- util/helperFunctions.js | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 util/helperFunctions.js (limited to 'util/helperFunctions.js') 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 -- cgit