camerakid
Member
Hey Everyone,
I bumped into an interesting logical problem. In some countries the decimal marking is different.
US: 1,000,000.10
Europe: 1 000 000,10
Spain: 1.000.000,10
So I was wondering what do you think is the best solution would be for showing large numbers in a game?
In my view the European is more logical by leaving spaces, so it is much easier to read out 100 million for everyone in the world:
100000000
100 000 000
Actually how would I draw spaces into my variable after converting it to a string, any ideas?
EDIT:
I came up with this solution can anyone suggest a more simpler one?
<code>
number=string(global.money);
if global.money>=0
{
number2=number;
}
if global.money>=1000
{
number2=string_insert(" ",number,2);
}
if global.money>=10000
{
number2=string_insert(" ",number,3);
}
if global.money>=100000
{
number2=string_insert(" ",number,4);
}
if global.money>=1000000
{
number1=string_insert(" ",number,2);
number2=string_insert(" ",number1,6);
}
if global.money>=10000000
{
number1=string_insert(" ",number,3);
number2=string_insert(" ",number1,7);
}
if global.money>=100000000
{
number1=string_insert(" ",number,4);
number2=string_insert(" ",number1,8);
}
text="$"+number2;
draw_text(x,y,text);
<code>
Thanks.
Attila
I bumped into an interesting logical problem. In some countries the decimal marking is different.
US: 1,000,000.10
Europe: 1 000 000,10
Spain: 1.000.000,10
So I was wondering what do you think is the best solution would be for showing large numbers in a game?
In my view the European is more logical by leaving spaces, so it is much easier to read out 100 million for everyone in the world:
100000000
100 000 000
Actually how would I draw spaces into my variable after converting it to a string, any ideas?
EDIT:
I came up with this solution can anyone suggest a more simpler one?
<code>
number=string(global.money);
if global.money>=0
{
number2=number;
}
if global.money>=1000
{
number2=string_insert(" ",number,2);
}
if global.money>=10000
{
number2=string_insert(" ",number,3);
}
if global.money>=100000
{
number2=string_insert(" ",number,4);
}
if global.money>=1000000
{
number1=string_insert(" ",number,2);
number2=string_insert(" ",number1,6);
}
if global.money>=10000000
{
number1=string_insert(" ",number,3);
number2=string_insert(" ",number1,7);
}
if global.money>=100000000
{
number1=string_insert(" ",number,4);
number2=string_insert(" ",number1,8);
}
text="$"+number2;
draw_text(x,y,text);
<code>
Thanks.
Attila
Last edited: