This site requires JavaScript, please enable it in your browser!
Greenfoot back

Report as inappropriate.

Ed.Betteridge
Ed.Betteridge presents ...

2013/10/3

Calculator (BigDecimal)

I am experimenting with BigDecimal to allow for all numbers (but still having some problems).

3435 views / 14 in the last 7 days

Tags: demo buttons with-source big math calculator calc betteridge ed decimal

open in greenfoot
Your browser does not support the canvas tag.
Ed.BetteridgeEd.Betteridge

2013/10/3

Does anyone know how to fix the problems with using 0's in a decimal?
Ed.BetteridgeEd.Betteridge

2013/10/3

You have to click 0 about five times for it to start adding zeros. I think it is to do with my MathContext (I need to show more precision, even though 111.0=111.00). My code is like this: mc=new MathContext(display.length());
Ed.BetteridgeEd.Betteridge

2013/10/3

I am going to try and use .SetScale();
A new version of this scenario was uploaded on Thu Oct 03 15:48:35 UTC 2013 Used .SetScale() Successfully
Ed.BetteridgeEd.Betteridge

2013/10/3

Still small bug of pressing . then 0, because . adds a zero anyway.
A new version of this scenario was uploaded on Thu Oct 03 17:57:35 UTC 2013
Ed.BetteridgeEd.Betteridge

2013/10/3

Still seems to be occasional glitch with very small decimals (0.00 20+)
Ed.BetteridgeEd.Betteridge

2013/10/3

more specifically, glitch is with numbers like 0.000...1111...000 etc

Want to leave a comment? You must first log in.

Who likes this?

No votes yet.