Increasing number of Decimals Dynamically

caribou-contests shared this question 6 years ago
Answered

I have this worksheet.


https://www.geogebra.org/m/1457011


As far as I know these conditions always hold true. However a colleague of mine pointed out a situation where it seems to not hold true.


2cd70d38d31699bed9a99f0f2f8185c5


The problem is that it just cannot be seen with 2 decimal places but the condition is still true. Can I dynamically change the number of decimals shown on screen?

Comments (6)

photo
1

I am not aware of a way to dynamically change rounding/significant digits, unless you allow menus to be in your app...Options allows you to change rounding.


Tony


Possibly,

oNumeric

Numeric[ <Expression> ]

Numeric[ <Expression>, <Significant Figures> ]

photo
1

I am not aware of a way to dynamically change rounding/significant digits, unless you allow menus to be in your app...Options allows you to change rounding.


Tony


Possibly,

oNumeric

Numeric[ <Expression> ]

Numeric[ <Expression>, <Significant Figures> ]


Thanks for the reply, I will see how I can use this to solve my problem! Thanks.


Maybe create my own buttons or slider that allow the user the increase and decrease the number of Significant Figures!

photo
1

I am not aware of a way to dynamically change rounding/significant digits, unless you allow menus to be in your app...Options allows you to change rounding.


Tony


Possibly,

oNumeric

Numeric[ <Expression> ]

Numeric[ <Expression>, <Significant Figures> ]


Thanks for the reply, I will see how I can use this to solve my problem! Thanks.


Maybe create my own buttons or slider that allow the user the increase and decrease the number of Significant Figures!


Problem with this. It is only available in CAS view, I need the numbers visible on the worksheet, is this possible with the numeric command?

photo
1

Hi,


you can't do it with labels, but it should work with texts (you can hide labels and replace them with texts, so this is no big problem).


* define the number n of decimal places you want to use: either use a slider and let user change it or compute it yourself using something like

    minDiff=Min[KeepIf[x>0,{abs(a-b),abs(b-c),abs(c-a)}]]

    n=Max[ceil(-log10(minDif)),1]

* open properties of your text, make sure it's not fixed

* set the rounding to something big, eg. 10 decimal places

* replace a,b,c with round(a,n), round(b,n), round(c,n)


Cheers,

Zbynek

photo
1

The file attached demonstrates the formula for c < a < b case, other 5 cases should be easy to adjust.

https://ggbm.at/1714713

photo
1

Hi,


you can't do it with labels, but it should work with texts (you can hide labels and replace them with texts, so this is no big problem).


* define the number n of decimal places you want to use: either use a slider and let user change it or compute it yourself using something like

    minDiff=Min[KeepIf[x>0,{abs(a-b),abs(b-c),abs(c-a)}]]

    n=Max[ceil(-log10(minDif)),1]

* open properties of your text, make sure it's not fixed

* set the rounding to something big, eg. 10 decimal places

* replace a,b,c with round(a,n), round(b,n), round(c,n)


Cheers,

Zbynek


Cool, thanks a lot! I'm going to try implementing this with a slider to give the user control.

© 2021 International GeoGebra Institute