Working with string

Get help using Construct 2

Post » Sun Oct 27, 2013 8:30 am

In my game, I have a quantity of money. Now I am going to add a point after hundreds, thousand etc. For example, with a value of 200000$ I want get this string: 200.000$. How can I do?
Sorry for english.
B
5
Posts: 17
Reputation: 337

Post » Sun Oct 27, 2013 12:22 pm

There is a plugin for that iirc, so look in the plugins forum.
Or take the approach:

localvar = ""
localvar2 = ""
- : localvar = str(number)
-- while
len(str(var))>3 : set localvar2 = "."&right(localvar,3)&localvar2
set localvar = left(localvar,len(localvar)-3)

- : set localvar2 = localvar&localvar2

localvar 2 contains your separated number
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 788
Reputation: 3,788

Post » Mon Oct 28, 2013 3:32 pm

Thanks you :).
B
5
Posts: 17
Reputation: 337


Return to How do I....?

Who is online

Users browsing this forum: Baidu [Spider], DrKoala, irina, zenox98 and 23 guests