Need help about integer...
Hi everyone!
I need help about my integer attribute.
I need to display it in game, but if it's a high number, i want to display it like 100.000 (not 100000), adding the "."
2nd exemple, 10.000 (not 10000)
Any way to do it?
Thank you very much!
I need help about my integer attribute.
I need to display it in game, but if it's a high number, i want to display it like 100.000 (not 100000), adding the "."
2nd exemple, 10.000 (not 10000)
Any way to do it?
Thank you very much!
Comments
Thanks
WOW that's strange lol... That works for 10000 and 1000 too? (1,000 10,000)
Thank you very much
How the hell you can do an insane expression like that? lol
(i'll try that later)
Thanks a lot man
floor( game.score /1000).."."..floor(( game.score -floor( game.score /1000)*1000)/100)..floor(( game.score -floor( game.score /100)*100)/10)..floor(( game.score -floor( game.score /10)*10)).." "
----------
Remember that you have to use the Expression Editor to put in game.score (or whatever attribute name you are using). Be careful: each and every parenthesis is important. (Those are the round brackets.)
I actually made a demo for you but there were some problems with publishing it. This expression does work though. I don't know exactly why it needs the .." " at the end but it does. (That's an alt-space between the quotes.)
And, I would have a rule in place so that it displays the unaltered number if it is less than a thousand, and the above expression otherwise.
Good luck!
Thanks, but don't works... for 100000 the display is 100 and for 99600, the display is 99.60 :S
Try by counting the round brackets (there should be 20).
Then, ensure that the brackets are all in the right places.
Also, make sure that the expression ends in .." " (period, period, quote, alt-space, quote).
In addition, ensure you have the correct number of zeros as well.
In other words: everything has to be exactly the same in order for this to work.
Thousands seperator demo
I think that you can download it and then use GameSalad to open it up. Each click on the screen will generate a random number between 1 and 100.000.
Great job