How do I Make High Numbers Into Words

0 favourites
  • 6 posts
From the Asset Store
Simple but fun word game. Restore an original word from shuffled letters.
  • I am trying to make a number like 1000,000 display as 1 million

    or a better example would be 152,000 as 1.52 Million and keep counting as it goes through the billions and trillions and so on

    Like Adventure Capitalist

    thanks for any help

  • Look into subevents in the manual to make a nested hierarchy of how you want to decide what gets the weird treatment. You'll need to compare if score > 1,000,000 change scoreText (or whatever you name your text/spritefont) to int(score/1000000) & "." & int((score-1000000)*.000001) & "million"

    Something along those lines, but check the math because I didn't bother counting zeroes on my phone. Just have a series of checks about how big the score is or isn't and format your text with some math.

  • Here, I made a quick .capx (in C2 208) to give you a rough example. You can toy with it to make it more to your liking, but I was just demonstrating how it could be done.

    http://www.adamcreations.com/show/millions.capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for the capx , I was able to alter it to display million trillion billion quadrillion quintillion but after that cant seem to go higher. I need to go up to numbers like decilion and way above any ideas. ??

  • Make it generic by storing your labels in an Array, write a loop to find the label you want based on an expression like "score < 10 ^ (loopindex * 3)" - since every label goes up every three powers of 10 (3 zeroes). Then you can add as many labels as you want into the Array.

  • Thanks for the reply tgfcoder I pick things up fairly quick , but what you said has shot right over my head , is there any chance of a small example. (if i see it il get it)

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