How do I format text as currency?

Just started using Construct 2? Post your questions here

Post » Sun Jun 15, 2014 10:05 pm

I don't seem to find an easy way to simply format text. Some thing like moneyText = "$"&str(moneyValue)

Looking for something like $ 35.37 or $35.40 the 35.40 gives me 35.4 want to see both decimal places.

Thanks in advance for any help.
B
17
S
7
G
3
Posts: 12
Reputation: 2,798

Post » Mon Jun 16, 2014 11:43 am

I'm not a insane, my mother had me tested

I'm an engineer. To save time, just assume I'm never wrong
B
31
S
13
G
4
Posts: 141
Reputation: 4,857

Post » Mon Jun 16, 2014 10:54 pm

randy70 wrote:I don't seem to find an easy way to simply format text. Some thing like moneyText = "$"&str(moneyValue)

Looking for something like $ 35.37 or $35.40 the 35.40 gives me 35.4 want to see both decimal places.

Thanks in advance for any help.


"$"&int(moneyValue)&"."&int((moneyValue-int(moneyValue))*100) should return the good value I think.
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
54
S
22
G
18
Posts: 2,123
Reputation: 17,150


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 2 guests