How do I Make a Currency Splitter

0 favourites
  • 4 posts
  • Hello Guys,

    I am working on a game that transforms the coins/money you earn from millions to billions and so on. But at one moment it wont work anymore. Maybe someone can help me or has a better ideea on how to do this.

    My problem is that from the Kabillion the text wont change to the next. It just get's stuck but the Variable increases. Maybe i missed something.

    The name of the Currencies wont matter it's just for example here.

    Thank you and have a nice day!

  • I googled this, looks like the biggest number in Construct is 9223372036854776000, which I think is less than 10^19, that's why last two events don't work.

    So you need to invent some other way to work with such big numbers.

    Maybe at some point in the game when the number of coins is already quite big (10^10 or so) and player doesn't care about hundreds and thousands, you can remove 6 last digits from the number and start counting in millions?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thank you very much man, really good answer cause I thought I hit rock bottom.

    Cheers!

  • Construct uses doubles for the numbers so the largest number is around 10^308. It's most certainly a bug:

    You can get around it by doing this:

    global number ten = 10

    money > ten^18

    money < ten^19

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)