How do I Format my Currency?

Get help using Construct 2

Post » Thu May 19, 2016 12:29 am

Ok, so I'm trying to figure out the best way to convert my currency to have commas as well as once it gets to the millions it states "1 Million" instead of "1000000", I have seen that RegexReplace may help but I am still quite Noobish and not sure the best way to approach this even with RegexReplace, Can someone shed some light on this?
Don't stop moving, the moment you do you'll realize what you have accomplished and settle with what you have.
B
19
S
11
G
5
Posts: 10
Reputation: 4,336

Post » Thu May 19, 2016 7:34 am

Image



Coming soon on Steam!
B
16
S
9
G
3
Posts: 204
Reputation: 3,466

Post » Thu May 19, 2016 11:09 am

mikehive wrote:Does this thread help? display-number-as-currency-with-commas_t73979 :)


Thanks for the reply! I tried this but I can't figure out how to implement the "Million" at the end, as well as shorted the variable to 1 so that it ends up being "1 million" How would I implement that?
Don't stop moving, the moment you do you'll realize what you have accomplished and settle with what you have.
B
19
S
11
G
5
Posts: 10
Reputation: 4,336

Post » Thu May 19, 2016 3:48 pm

do something like set text to variable &" Million "

What this is that the variable is the number of that million and the "&" is just a placement to tell the code to add something the (" Million ") is telling what non variable text to put here.

So it should turn out like 1 Million on your textbox.

If i am guessing right you are making something like a farming type game or idle so add this condition if Million is not equal to zero set text to variable&" Million " So in other word If million is at zero it will not run but if it more then zero then it will set the text. This is the easy version There are other more complex version.

But id suggest to try to label each text box according to the value it represent. so one for million , hundred thousand, ten thousand and so on. This would make it really easy to keep track of where you are with the currency. rather then having a total number divided by the next current number.
B
52
S
24
G
6
Posts: 391
Reputation: 7,845


Return to How do I....?

Who is online

Users browsing this forum: yiuyiu6666 and 26 guests