I want to change the number displayed. Like 100A
1,000 → 1A
10,000 → 10A
1,000,000 → 1B
I want to change the number as in the above way I would like to know how .
Let me know how to change 'll ask me
Best Answers
-
SLOCM3Z Posts: 797
If game.Number < 1,000
:do:
display text: game.NumberIf game.Number > 1,000
If game.Number < 10,000
:do:
display text: 1AIf game.Number > 10,000
If game.Number < 100,000,000
:do:
display text: 10AIf game.Number > 100,000,000
If game.Number < 1,000,000,000
:do:
display text: 1BThere may be a better way and I think @RThurman made a demo on it. But this is how I would do it.
-
Socks London, UK.Posts: 12,822
@jdlcrater said:
If game.Number < 1,000
:do:
display text: game.NumberIf game.Number > 1,000
If game.Number < 10,000
:do:
display text: 1AIf game.Number > 10,000
If game.Number < 100,000,000
:do:
display text: 10AIf game.Number > 100,000,000
If game.Number < 1,000,000,000
:do:
display text: 1BThere may be a better way and I think @RThurman made a demo on it. But this is how I would do it.
You don't really need to bracket the values like this, so rather than . . . . . .
if >1000 and <10,000
If >10,000 and <100,000
If >100,000 and <1,000,000
etc etc . .
(note: this system will not register 1,000 or 10,000 as it only looks for larger or smaller than - and never equal to)
. . . . you can simplify it with . . .
If N < 1000 - then action
-Otherwise - if N < 10,000 - then action
--Otherwise - if N < 100,000 - then action
---Otherwise - if N < 1,000,000 - then actionetc etc . .
Answers
oh!!
cool.
Thanks a lot.
@gyyg, like I said, "A much better way to do it." AND it registers the right numbers. Thanks @Socks
Are you only needing to display those three numerical values or also everything in between? In other words, will you need to alter the way that 2000 is displayed or the way that 77638 is displayed? If so, you'll need a different method to convert the numbers.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User