mkulesh / microMathematics

microMathematics Plus - Extended visual calculator
GNU General Public License v3.0
561 stars 68 forks source link

Format Result as Fraction #119

Closed shrimprugbysnowowl closed 1 year ago

shrimprugbysnowowl commented 2 years ago

Feature Request

It would be useful to be able to format a result as a fraction, or allow the decimal portion of a result as a fraction, similar to SI architectural measurements (i.e. 8.791666666667 feet vs 8'-9 1/2").

Just discovered microMath, and it looks like an excellent open source alternative to MathCAD!

mkulesh commented 1 year ago

Hi @shrimprugbysnowowl thank you for the proposal. I will try to add this possibility using https://commons.apache.org/proper/commons-numbers/ libraries. More technical information: the similar question was discussed on https://stackoverflow.com/questions/474535/best-way-to-represent-a-fraction-in-java

mkulesh commented 1 year ago

Hi @shrimprugbysnowowl I implemented a first drop of the fraction representation: fraction

The fraction representation is activated in the result property dialog that appears when you long press on the result formula and than press "Object property" floating button: fraction1

It works, but some points are not really clear for me:

Do you like to have an APK for the testing?

shrimprugbysnowowl commented 1 year ago

Very cool! When I submitted the suggestion, I was using the app to perform calculations in imperial architectural units which are typically shown as: [integer feet] - [integer inches] [fractional inch] As it relates to this app, I personally think it would be useful to show integers separately from a fraction, but someone may also want the option to show "improper fractions".

I don't have enough exposure with complex numbers to have an opinion if fractions should be used with "i". Sorry

I'd love an APK for testing! Awesome work!

mkulesh commented 1 year ago

Hi @shrimprugbysnowowl thanks, I will modify the representation in order to show integers separately from a fraction and provide you a test APK tomorrow.

mkulesh commented 1 year ago

Hi @shrimprugbysnowowl

please download and manually install this test APK: https://1drv.ms/u/s!At2sh2-YDyGFgSYciWpo4LRq-roW?e=ood4II

It is just an initial implementation, some bugs can exist here and I still testing it.

shrimprugbysnowowl commented 1 year ago

The test apk works very well. I haven't noticed any bugs

mkulesh commented 1 year ago

To be merged into free version

mkulesh commented 1 year ago

Released in versions 1.23 and 2.23