summaryrefslogtreecommitdiff
path: root/npc/other/Global_Functions.txt
diff options
context:
space:
mode:
authorEmistry <Equinox1991@gmail.com>2015-07-14 22:11:26 +0800
committerEmistry <Equinox1991@gmail.com>2015-07-14 22:11:26 +0800
commitd93ed2a26dab220632d523caea0358d33dda7051 (patch)
treed8c3f3fa7e60a351d2ead8a46f036640809feca4 /npc/other/Global_Functions.txt
parentebde1c70b3288f0909cb13c4b6be91c21a8e8da4 (diff)
downloadhercules-d93ed2a26dab220632d523caea0358d33dda7051.tar.gz
hercules-d93ed2a26dab220632d523caea0358d33dda7051.tar.bz2
hercules-d93ed2a26dab220632d523caea0358d33dda7051.tar.xz
hercules-d93ed2a26dab220632d523caea0358d33dda7051.zip
Added F_InserComma
Merge from rAthena. Returns a number with commas between every three digits.
Diffstat (limited to 'npc/other/Global_Functions.txt')
-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
//////////////////////////////////////////////////////////////////////////////////