How do I Make High Numbers Into Words

Just started using Construct 2? Post your questions here

Post » Sun Jul 12, 2015 12:36 am

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
B
7
S
1
Posts: 18
Reputation: 1,196

Post » Sun Jul 12, 2015 5:28 am

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.
B
103
S
38
G
19
Posts: 962
Reputation: 17,986

Post » Sun Jul 12, 2015 5:51 am

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
B
103
S
38
G
19
Posts: 962
Reputation: 17,986

Post » Sun Jul 19, 2015 3:51 pm

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. ??
B
7
S
1
Posts: 18
Reputation: 1,196

Post » Mon Jul 20, 2015 7:09 am

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.
B
10
S
2
Posts: 33
Reputation: 710

Post » Mon Jul 20, 2015 9:25 am

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)
B
7
S
1
Posts: 18
Reputation: 1,196


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 4 guests