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

#1 2009-08-22 19:44:24

siderits
Scratcher
Registered: 2009-04-26
Posts: 21

decimal places question

Hello:

I'm trying to multiply 0.0002283 by 7.7 and all I get in the resulting variable is 0.0

Can someone point out what I'm doing wrong or how I can change the decimal places in the result to see the answer?

Thanks

Sid

Offline

 

#2 2009-08-22 20:35:35

-db-
Scratcher
Registered: 2009-06-04
Posts: 100+

Re: decimal places question

it rounds to the nearest tenth. the actual answer is 0.00175791, and it rounds the answer to 0.0 I'm not sure how to fix that, or make it show more answers, but i know what the problem is anyway.


http://i31.tinypic.com/2n8ofg4.jpg

Offline

 

#3 2009-08-23 07:14:34

siderits
Scratcher
Registered: 2009-04-26
Posts: 21

Re: decimal places question

db:
Thanks for the response.  I think that I can get the precision that I need by writing to (insert) and pulling from a list.  That seems to let me keep all of the decimal places for the equations.
Cheers;
Sid

Offline

 

#4 2009-08-23 08:07:22

siderits
Scratcher
Registered: 2009-04-26
Posts: 21

Re: decimal places question

It worked.  To get the number out of the list, with all of the decimal places places, I used a "Thought Bubble".  It's kind of funny to see a result field of 0.0 with a Thought bubble of 0.00002783
Thanks

Sid

Offline

 

#5 2009-08-23 08:48:45

siderits
Scratcher
Registered: 2009-04-26
Posts: 21

Re: decimal places question

OK, final update.  You can use a "list" as a "math engine" and set variables to the values taken from the list, doing math with the values and storing them back in the list.  In this way you can report values and results with 15 or 20 place decimals. 
It works great!  The "Thought bubble works in the same way.
Sid

Offline

 

Board footer