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

#1 2013-02-07 17:50:53

CAA14
Scratcher
Registered: 2013-01-14
Posts: 1000+

How to make the timer round without the decimal point

Hi,

More specifically, how to round a variable to an integer, without a decimal point.

Regards,

CAA14

Offline

 

#2 2013-02-07 18:51:52

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: How to make the timer round without the decimal point

CAA14 wrote:

Hi,

More specifically, how to round a variable to an integer, without a decimal point.

Regards,

CAA14

Well, this is actually quite simple. Just use this:

(round (timer))

Or this, which rounds down:

(round ((timer) - (0.5)))

Note:

Round down, in other terms, basically means "chopping off" all decimal places.


I hope that this helps!

Last edited by ErnieParke (2013-02-07 18:53:15)


http://i46.tinypic.com/35ismmc.png

Offline

 

#3 2013-02-07 19:35:21

CAA14
Scratcher
Registered: 2013-01-14
Posts: 1000+

Re: How to make the timer round without the decimal point

Hi,

Thanks again Ernie.  smile

I'll try that.

Regards,

CAA14

Offline

 

Board footer