How do I make large numbers into words?

Get help using Construct 2

Post » Tue Dec 15, 2015 6:45 pm

Actually, I know how :D ...but I am having trouble... :x

I set it up as :

Money > xxxx
Money < xxxx = System set (Quadrillion) to int(Money/1000000000000000)
= Set text to "Money is - $" &Quadrillions & "." &int((Money-(Quadrillions*1000000000000000))*0.00000000000001) & " Quadrillion"

Okay, all is fine and dandy, but when you reach Quintillion (and up) , it's like C2 isn't recognizing the exponent.

So, at Quadrillion, the game will actually display " XX Quadrillion"

But at Quintillion it'll just say "$1000000000000000000"

And if you reach something like Septillion, it'll just show the exponent.... Like "$1e+24"
B
7
S
1
Posts: 10
Reputation: 347

Post » Tue Dec 15, 2015 6:58 pm

Is both Money > xxxx and Money < xxxx in the same event?
If you had a screenshot it would be easier to read (at least for me)
(\__/)

(='.'=)

(")_(")
B
23
S
10
G
1
Posts: 74
Reputation: 3,244

Post » Tue Dec 15, 2015 7:00 pm

Yes, they are both conditions. It works for Million through Quadrillion, but not any further. I think it's because C2 starts recognizing the number defined as exponents. The expression like "1e+30", instead of the actual integer "1000000000000000000000000000000".

But I don't think I can use this method using the "1e+30" type of formula.
B
7
S
1
Posts: 10
Reputation: 347

Post » Tue Dec 15, 2015 7:06 pm

Computers have a maximum range for storing integers. Javascript is further limited. What are your minimum/maximum numbers? Unless you start at 1, you can probably use a scaling factor to get accurate values.
ImageImageImage
B
71
S
21
G
212
Posts: 3,616
Reputation: 119,661

Post » Tue Dec 15, 2015 7:07 pm

It goes to scientific notation because I think the limit for an integer is 2^32 or 2^64.
(\__/)

(='.'=)

(")_(")
B
23
S
10
G
1
Posts: 74
Reputation: 3,244

Post » Tue Dec 15, 2015 7:16 pm

I'm pretty sure the limit for the integer is even lower than that or it'd be working up to a Decillion. So far I want a limit to a Vigintilliion, which would be 1e+60. But I can't get past a Quintillion. I'm trying to think of more things people will spend money on, so their numbers don't get too high. I also thought about using "Vaults" or "Banks" to store a maximum, and then you start on your next storage facility, but that's kind of silly with the theme of the game.

Eventually it'll be multiplayer and this most likely won't be an issue, but for now it's just an idle-click game. :/
B
7
S
1
Posts: 10
Reputation: 347

Post » Tue Dec 15, 2015 8:53 pm

You could always include a more "valueable" currency. /Platinum Supergold Plasma etc../
(\__/)

(='.'=)

(")_(")
B
23
S
10
G
1
Posts: 74
Reputation: 3,244


Return to How do I....?

Who is online

Users browsing this forum: Krakcz, shushpo and 12 guests