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

#1 2012-03-23 20:51:29

TorbyFork234
Scratcher
Registered: 2012-03-01
Posts: 1000+

How to round to the nearest hundredth?

As the title says, How do I make a number be rounded to the nearest hundredth?

Offline

 

#2 2012-03-23 20:57:16

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: How to round to the nearest hundredth?

set [rounded number] to ((round((number)*(100)))/(100))

Last edited by MoreGamesNow (2012-03-23 20:58:33)


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#3 2012-03-31 09:39:13

jontmy00
Scratcher
Registered: 2011-11-28
Posts: 1000+

Re: How to round to the nearest hundredth?

MoreGamesNow wrote:

set [rounded number v] to ((round((number)*(100)))/(100))

Fixed your script.


FOR ALL THE NEWS ON UPDATES FOR SIMPLISTICRAFT, CLICK HERE.

Offline

 

#4 2012-03-31 23:11:32

chanmanpartyman
Scratcher
Registered: 2011-05-30
Posts: 500+

Re: How to round to the nearest hundredth?

set [number v] to ((100) * ( round ((number) / (100))))
Then there is always Scientific Notation:
set [number v] to ([10^ v] of (number))

Last edited by chanmanpartyman (2012-03-31 23:14:25)

Offline

 

Board footer