mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 23:04:08 +10:00
@@ -374,7 +374,10 @@ Toy_String* Toy_stringifyValue(Toy_Bucket** bucketHandle, Toy_Value value) {
|
|||||||
|
|
||||||
//find the decimal, if it exists
|
//find the decimal, if it exists
|
||||||
unsigned int decimal = 0;
|
unsigned int decimal = 0;
|
||||||
while (decimal != length && buffer[decimal] != '.') decimal++;
|
while (decimal != length && buffer[decimal] != '.' && buffer[decimal] != ',') decimal++; //'.' and ',' supports more locales
|
||||||
|
|
||||||
|
//locales are hard, sorry!
|
||||||
|
if (decimal != length && buffer[decimal] == ',') buffer[decimal] = '.';
|
||||||
|
|
||||||
//wipe the trailing zeros
|
//wipe the trailing zeros
|
||||||
while(decimal != length && buffer[length-1] == '0') buffer[--length] = '\0';
|
while(decimal != length && buffer[length-1] == '0') buffer[--length] = '\0';
|
||||||
|
|||||||
@@ -630,7 +630,7 @@ static void processIndex(Toy_VM* vm) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Toy_error("Incorrect number of elements found in index");
|
Toy_error("Incorrect number of elements found in index");
|
||||||
//URGENT: clear stack, then leave null
|
//TODO: clear stack, then leave null?
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user