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

#1 2008-03-13 12:12:52

scratchmaker123
Scratcher
Registered: 2008-03-13
Posts: 3

variable rounding

I'm trying to make a scratch program that calculates Pi, but I can't because the variable keeps on rounding itself! Is there a way to make it stop doing that?

Offline

 

#2 2008-03-13 12:15:13

scratchmaker123
Scratcher
Registered: 2008-03-13
Posts: 3

Re: variable rounding

Oh, and it rounds to 3.1. I want hundreds of digits!!

Offline

 

#3 2008-03-13 12:18:16

Rukqo
Scratcher
Registered: 2008-01-17
Posts: 100+

Re: variable rounding

Sorry, Scratch only goes to the tenth digit. I think.

Offline

 

#4 2008-03-13 12:19:51

scratchmaker123
Scratcher
Registered: 2008-03-13
Posts: 3

Re: variable rounding

no I've gotten t to go past that (but only in a bug in my game!)

Offline

 

#5 2008-03-13 13:23:08

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

Re: variable rounding

I belive if you use the Say block, it will show more digits, but only online.  Another approach that works well both online and in Scratch is to use Kevin Karplus's project:  Print Decimal which will print up to 15 places to the right of the decimal point.

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

I used this in my Pi projects and it worked fine.


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

Offline

 

#6 2008-03-14 09:03:14

kevin_karplus
Scratcher
Registered: 2007-04-27
Posts: 1000+

Re: variable rounding

I recommend the newer print_scientific

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

Offline

 

Board footer