This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-11-14 14:20:48

group9socialjustice
New Scratcher
Registered: 2012-09-19
Posts: 1

variables

I am trying to make a money game to use in my classroom. I created new variables to keep track of the money being used in the game but it only goes to one decimal place. Is there a way to make it have at least two decimal places so it will show values like 10.25?

Offline

 

#2 2012-11-16 08:25:40

30-1
Scratcher
Registered: 2012-08-08
Posts: 100+

Re: variables

Yes. If you use

set [money v] to [10.25]
and
change [money v] by [0.01]
It will come in two decimal places.


http://i.imgur.com/ocOya7x.gif
I. Text I Based I Games I

Offline

 

#3 2012-11-16 13:27:33

Llamalover
Scratcher
Registered: 2007-05-18
Posts: 100+

Re: variables

It'll probably only show one decimal place if the second digit to the right of the decimal point is a 0, and if you're using sliders, but if all else fail, try using one variable for the numbers to the left of the point, and one for numbers to the right?


Be nice, I'm an old lady  wink

Offline

 

Board footer