Counting Money variable

Hello everyone!
I need your help and thank you in advance for your time …
I am preparing a project following your video tutorial “Counting Money Game Using Number Variables”
I would like to ask you if it is possible to make the zero appear after the 5 as well. (See in the image where the red arrow marks)
Instead of € 2.5 the variable should display € 2.50
Greetings to you!

ActivePresenter version: 8.2.0

OS: MacOs 10.13.6

Notes:

Hi Betty,

Please add the following JavaScript code to display the total money in two decimals format.
prez.variable(‘count’, prez.variable(‘count’).toFixed(2));

Regards,

1 Like

Fantastic! It works wonders!
Thank you so much Nam!
Best regards

1 Like

Hi Nam,
sorry if i still disturb you on this topic …
I’ve been trying and trying the variable with coins for days, but every time I try the digit in the variable it goes crazy.
Example:
I have to pay € 3.90
I drag the coins, but when I get to € 3.80 the figure you see in the image comes out.
This problem happens even if I use the “toFixed (2))” method
I hope it is a solvable problem.
I thank you so much for your help.
Best regards

Hi Betty,

Please use this function after all calculations:

prez.variable(‘count’, parseFloat(prez.variable(‘count’).toFixed(2)));

Regards,

1 Like

Thanks for your precious help, you are great! :heart:

1 Like