summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--npc/other/Global_Functions.txt13
1 files changed, 13 insertions, 0 deletions
diff --git a/npc/other/Global_Functions.txt b/npc/other/Global_Functions.txt
index 4e9060419..0475ff0a8 100644
--- a/npc/other/Global_Functions.txt
+++ b/npc/other/Global_Functions.txt
@@ -43,6 +43,19 @@
//////////////////////////////////////////////////////////////////////////////////
+// Returns a number with commas between every three digits.
+// -- callfunc "F_InsertComma",<number>
+// Examples:
+// callfunc("F_InsertComma",7777777) // returns "7,777,777"
+//////////////////////////////////////////////////////////////////////////////////
+function script F_InsertComma {
+ set .@str$, getarg(0);
+ for (set .@i,getstrlen(.@str$)-3; .@i>0; set .@i,.@i-3)
+ set .@str$, insertchar(.@str$,",",.@i);
+ return .@str$;
+}
+
+//////////////////////////////////////////////////////////////////////////////////
// Function that clears job quest variables
//////////////////////////////////////////////////////////////////////////////////