Any Plugins That Help With Showing Numbers as Currency?

Discussion and feedback on Construct 2

Post » Tue Dec 06, 2016 6:55 pm

I want the player to see the gold he or she collects as currency instead of just lines of number with no comma between the digits. Is there any plugins that do this?
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,378

Post » Tue Dec 06, 2016 11:42 pm

I feel like ive looked at every tutorial on the page and i did not see any talking about how to show commas with our currency text object. Is there a simple way to go about doing this? With economy games and just the sheer fact that most games do use some type of counting method proves that this would be a very helpful plugin or behavior to have for all of us that fail at math. Its just not polished to have numbers look the way they do out the box if you plan on showcasing a value that is like gold or money.
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,378

Post » Wed Dec 07, 2016 12:21 am

Depending on what you need to do, you could work with the parsing options that C2's system expressions give.
Like left, right or mid, combined with "&".

Now I'm not familiar with javascript, so I won't be able to create a plugin, but if you tell me how you want your numbers to be formatted, I can setup a way by using the above mentioned expressions.
"We can't solve problems by using the same kind of thinking we used when we created them."
- Albert Einstein
B
27
S
11
G
8
Posts: 528
Reputation: 7,091

Post » Wed Dec 07, 2016 1:04 am

@randomly Im just trying to figure out how to have my text numbers to add commas automatically. Its so common that you would think that it should be implemented in engine as an out the box feature.

instead of portraying my one million as so 1000000 i would like to see ten thousand like this 10,000 instead of like this 10000 as an example. I would like commas to be added as the gold amount scales. The issue is if i dont really get how to do this and try to implement it within my inventory system i feel like im going to have issues. This is why i think it would be awesome to have a stable way for all of us to be able to do this. its just so common that we portray numbers as currency in games.

I would be grateful to get your help and thanks for the feedback aswell.

one more thing, would a plugin like this be easy to make?
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,378

Post » Wed Dec 07, 2016 5:35 am

@rexrainbow would it be alot to ask of you to look into something like this? i seen you make some of the most used plugins and compared to that i feel something like this would be pretty easy for you.
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,378

Post » Wed Dec 07, 2016 6:03 am

Number string with decimal mark, "Expression:ToDecimalMark", in rex_systemext.

Reference
B
108
S
26
G
267
Posts: 4,456
Reputation: 149,747

Post » Wed Dec 07, 2016 2:08 pm

@rexrainbow you are epic! was this always here because i never knew we had this! You just made my life alot better! Thank you so much.
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,378

Post » Wed Dec 07, 2016 4:48 pm

Goddamnit, I'm too late.
Anyways, if anybody wants a non-plugin variant...purely C2 code...
here's my capx...

Download
"We can't solve problems by using the same kind of thinking we used when we created them."
- Albert Einstein
B
27
S
11
G
8
Posts: 528
Reputation: 7,091

Post » Sun Dec 11, 2016 7:22 pm

@randomly thank you for your example! im grateful to learn in many ways and yours is just as valid. That said @rexrainbow thank you again aswell. cheers!

I will have a small demo soon i would like you guys to try my project out.
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,378


Return to Construct 2 General

Who is online

Users browsing this forum: Artpunk and 9 guests