:D
This commit is contained in:
commit
09ade10207
117 changed files with 2153 additions and 0 deletions
|
@ -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;
|
||||
}
|
|
@ -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",
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue