so_many_mars/scripts/string_fix/string_fix.gml
Tyrel Souza 8854b848bc init
2022-02-21 18:45:19 -05:00

17 lines
534 B
Plaintext

// Script assets have changed for v2.3.0 see
// https://help.yoyogames.com/hc/en-us/articles/360005277377 for more information
function string_fix(){
///string_fix(number,places)
//Returns a zero-padded (or cut) string of the number so that it gets desired number of places.
var del;
argument0 = string(floor(argument0))
del = string_length(argument0) - argument1
if(del>0){
return string_delete(argument0,1,del)
}
else if(del<0){
return string_repeat("0",-del) + argument0
} else {
return argument0
}
}