Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[new-unit] Fractions to Decimal Representation #201

Open
fohfuu opened this issue Dec 20, 2022 · 3 comments
Open

[new-unit] Fractions to Decimal Representation #201

fohfuu opened this issue Dec 20, 2022 · 3 comments

Comments

@fohfuu
Copy link

fohfuu commented Dec 20, 2022

Description
Fractions to decimals and decimals to fractions is useful in many circumstances - Arithmetic, circle geometry and converting non-decimal measurement systems to metric (i.e. issue #148), etc. It is a standard on scientific calculators for this reason.

Units to be added

Unit name Property Reference to the conversion formula
Fractions Numeral System link
@ferraridamiano
Copy link
Owner

If issue #148 will be fixed, this unit is redundant, isn't it?

@fohfuu
Copy link
Author

fohfuu commented Jan 10, 2023

I would like an option that converts decimal to fraction and vice versa on its own.

For one, most converted units would be displayed as mixed fractions - like $1^1/_2$". Taking the mixed fraction and converting back it to an improper fraction - $(1×3)+ ^1/_3 = ^3/_2$ - adds an unnecessary layer of effort.

But, for two, this makes the converter more versatile for a variety of situations. Various sciences use fractions due to the difficulties of rational numbers that can only be represented with reptends (infinitely repeating decimals). I can find some examples of how they're used in chemistry, if needs be, but to choose a simpler example, they can also represent ratios.

Aspect Ratio

A screen is 720x1280. To find the aspect ratio of this screen:

$720÷1280=1.77777777$

Then convert decimals to fractions:

Input
1.77777777
Repeating digits
8
Output
$^{16}/_9$

So the aspect ratio is 16:9.

You can see an example of a Decimal to Fraction converter here:
Decimal To Fraction Calculator

The creator chose to leave an option for users to specify the number of repeating digits:

0.8333... repeating

Input
0.83333333
Repeating digits
7
Output
$^5/_6$

0.333... repeating

Input
0.3
Repeating digits
1
Output
$^1/_3$

However, there are a thousand ways to implement this sort of function, with more or less complexity. The average scientific calculator doesn't allow the user to specify the repeating digits and still does the job. It depends on how you would want to implement it.

Apologies for the multiple edits - I'm on a device that doesn't support Github's maths formatting, so I'm doing it all by hand.

@bagnacauda
Copy link

I would like to have this feature implemented too. Sometimes it just makes more sense to enter a fraction, and readability is much improved also.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants