Storing currency in a variable?

0 favourites
  • 3 posts
From the Asset Store
Easily store, modify, read and manipulate colors with Color Variables!
  • Hi all,

    Does anyone know how to store real money currency in a global variable, then use a text object to display the currency, and on "every tick", subtract and add to the global variable with decimals 0.10 etc as you win win or lose.

    I have been able to take the currency from my database and it shows correctly in a text field, but when i set a text object to display the global variable, it only shows 10, but it should show 10.00.



  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • All I can think of is maybe multiply the number by a 1000 when storing it in the global variable. Then, when you set the text, use float(globalVariable/1000).

  • Hey thanks for the reply and sorry for the late response, but better late than sorry right.

    I didn't have to do anything of that btw, i just had to assign float to the balance when i assign the variable and it updated the currency automatically.



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