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

#1 2008-12-03 12:43:43

Dan01
Scratcher
Registered: 2008-06-11
Posts: 100+

Variables - More than 1 decimal place.

How do I set a variable to a number which has more than 1 decimal place. So instead of 1.0 I see 1.000001 for example.


http://img3.imageshack.us/img3/4743/ubd6522wp8.png
http://img3.imageshack.us/img3/4667/ubd3758ox2.png

Offline

 

#2 2008-12-03 12:54:34

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: Variables - More than 1 decimal place.

Dan01 wrote:

How do I set a variable to a number which has more than 1 decimal place. So instead of 1.0 I see 1.000001 for example.

Well, you can use the Say block...it shows more decimal places.  Or, what I usually do, is use Kevin Karplus's Print Decimal project which stamps the numbers out. 

http://scratch.mit.edu/projects/kevin_karplus/2951


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#3 2008-12-03 13:00:57

Dan01
Scratcher
Registered: 2008-06-11
Posts: 100+

Re: Variables - More than 1 decimal place.

Paddle2See wrote:

Dan01 wrote:

How do I set a variable to a number which has more than 1 decimal place. So instead of 1.0 I see 1.000001 for example.

Well, you can use the Say block...it shows more decimal places.  Or, what I usually do, is use Kevin Karplus's Print Decimal project which stamps the numbers out. 

http://scratch.mit.edu/projects/kevin_karplus/2951

Do you know of any quicker ways, as printing each digit is a bit slow and saying the number is only 2 decimal places.


http://img3.imageshack.us/img3/4743/ubd6522wp8.png
http://img3.imageshack.us/img3/4667/ubd3758ox2.png

Offline

 

#4 2008-12-03 15:14:02

Lucario621
Community Moderator
Registered: 2007-10-03
Posts: 1000+

Re: Variables - More than 1 decimal place.

Yeah...thats one of the things thats one of the downsides of scratch...I hope they atleast fix it. But as far as I know, inside the actual scratch program it does use all decimal places.


http://i.imgur.com/WBkM2QQ.png

Offline

 

Board footer