How do I Format my Currency?

0 favourites
  • 4 posts
  • 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?

  • Does this thread help?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Does this thread help?

    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?

  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)