Darkempire78 / OpenCalc

A simple and beautiful calculator for Android
GNU General Public License v3.0
868 stars 100 forks source link

Fraction form for decimal numbers #15

Open Tanmandal opened 2 years ago

Tanmandal commented 2 years ago

Fraction for decimal answer

Darkempire78 commented 2 years ago

It works, what is the issue ? @Tanmandal

Tanmandal commented 2 years ago

For example if the answer is 7.5 the 15/2 or 7½ must be shown as in google calculator IMG-20220805-WA0004

inson1 commented 1 year ago

I think it would be good option to have. Ofc in the future.

Darkempire78 commented 1 year ago

Idk how to implement this to be honest, an idea everyone ?

inson1 commented 1 year ago

@Darkempire78 https://www.geeksforgeeks.org/convert-given-decimal-number-into-an-irreducible-fraction/

https://stackoverflow.com/questions/32888531/how-do-i-write-a-fraction-in-android-studio

Unicode could be maybe promissing?

Darkempire78 commented 1 year ago

I do not really understand when Google converts the result to fraction, it seems weird. 🤔 Otherwise, perhaps that we can add an option to convert the result to fraction when you click it (and reverse)). What do you think ? If you have another idea tell me @inson1 @Tanmandal

inson1 commented 1 year ago

@Darkempire78

I do not really understand when Google converts the result to fraction, it seems weird. 🤔

What do you mean?

Maybe option in settings with four options to choose from?

  1. Only decimal numbers (default)
  2. Only fractions
  3. Default decimal numbers and after the click on the result, it converts to fractions
  4. Default fractions and after the click on the result, it converts to decimal numbers

Is that too much? 🤔 On other hand, that are all scenarios, that could someone want, I think. What do you think?

Darkempire78 commented 1 year ago

@inson1

What do you mean?

I mean that every result can be converted to fraction even 2.64547 which is 264547/100000 or 2.756 to 689/250. So when should be convert the result to fractions ? Google's calculator does not convert every time because it will be very boring

inson1 commented 11 months ago

@Darkempire78 Do you know when it converts? What is "interesting"?

Darkempire78 commented 11 months ago

@Darkempire78 Do you know when it converts? What is "interesting"?

No I do not :/

inson1 commented 11 months ago

@Darkempire78 Maybe we should just add that 4 options and if someone has idea about what is interesting then he can share it.

yea I hoped that you had or you come up last month with idea or theory abou that, because I also dont have any idea tbh.

inson1 commented 11 months ago

@Darkempire78 That would be 5. option anyway. Maybe we should create discussion about that and this issue should be only about the 4 options.

inson1 commented 11 months ago

388

Darkempire78 commented 4 months ago

See pull request #480