I want to change the number displayed. Like 100A

gyyggyyg Member, PRO Posts: 2

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

  • SLOCM3ZSLOCM3Z Posts: 797
    Accepted Answer

    If game.Number < 1,000
    :do:
    display text: game.Number

    If game.Number > 1,000
    If game.Number < 10,000
    :do:
    display text: 1A

    If game.Number > 10,000
    If game.Number < 100,000,000
    :do:
    display text: 10A

    If game.Number > 100,000,000
    If game.Number < 1,000,000,000
    :do:
    display text: 1B

    There may be a better way and I think @RThurman made a demo on it. But this is how I would do it.

  • SocksSocks London, UK.Posts: 12,822
    edited December 2015 Accepted Answer

    @jdlcrater said:
    If game.Number < 1,000
    :do:
    display text: game.Number

    If game.Number > 1,000
    If game.Number < 10,000
    :do:
    display text: 1A

    If game.Number > 10,000
    If game.Number < 100,000,000
    :do:
    display text: 10A

    If game.Number > 100,000,000
    If game.Number < 1,000,000,000
    :do:
    display text: 1B

    There 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 action

    etc etc . .

Answers

  • gyyggyyg Member, PRO Posts: 2

    oh!!
    cool.
    Thanks a lot.

  • SLOCM3ZSLOCM3Z Member Posts: 797

    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 action

    etc etc . .

    @gyyg, like I said, "A much better way to do it." :lol: AND it registers the right numbers. Thanks @Socks :)

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    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

Sign In or Register to comment.