This commit is contained in:
the me 2022-08-07 14:14:04 -07:00
commit 09ade10207
117 changed files with 2153 additions and 0 deletions

View file

@ -0,0 +1,27 @@
function string_extend_digits(str, integers, decimals=0) {
var ints = 0;
var decs = 0;
if decimals decimals++;
var i;
for (i=0; i<string_length(str); i++) {
if string_pos(".", str) <= i+1 {
decs++;
} else if string_pos(".", str) > i+1 {
ints++;
}
}
integers -= ints;
decimals -= decs;
while integers {
str = "0" + str;
integers--;
}
while decimals {
if !string_pos(".", str) {
str = str + ".";
}
str = str + "0";
decimals--;
}
return str;
}

View file

@ -0,0 +1,12 @@
{
"isDnD": false,
"isCompatibility": false,
"parent": {
"name": "convenience",
"path": "folders/Scripts/convenience.yy",
},
"resourceVersion": "1.0",
"name": "string_extend_digits",
"tags": [],
"resourceType": "GMScript",
}