ferraridamiano / ConverterNOW

The Unit Converter app: easy, immediate and multi-platform
https://converter-now.web.app
GNU General Public License v3.0
390 stars 60 forks source link

Imperial conversion in fractions (Not just decimals) #148

Open ferraridamiano opened 2 years ago

ferraridamiano commented 2 years ago

Discussed in https://github.com/ferraridamiano/ConverterNOW/discussions/147

Originally posted by **trymeouteh** April 26, 2022 When converting from metric to imperial in many units such as length, you get a decimal result for the imperial unit. When you use length in Imperial, you do not go by the decimal by in fractions such as 1 3/4 inches for example instead of 1.75 inches. I not against removing decimal results for imperial conversions but to also include fractional results which can be done in a few ways. Lets say the imperial decimal result is 1.8 inches. This is between 1 3/4 and 1 13/16 inches and the result can be displayed as between 1 3/4 - 1 13/16. It can also be displayed as ~1 13/16 since it is approx 1 13/16. A setting could be added on how much to break down a fractional result and I think 16th of a unit should he the default setting since its not too common to have to break down an imperial unit more than 16 fractional units.
ferraridamiano commented 2 years ago

Well, it could be done! I need time to think about an easy to use UI with all the unique cases. Before starting it could be helpful to have a complete list of units that should have this behaviour. @trymeouteh could you help me in this? Do not ask for ETA because I'm quite busy and I'm not able to make any prediction. If anybody want to try this, I'm open to every PR.

trymeouteh commented 2 years ago

Im not much of a developer but I know thing or two on computers as a linux user. I will provide a list of units and try to find a Dart library to convert decimal numbers into fractions.

ferraridamiano commented 2 years ago

It's not a problem to convert to fraction, in this case it is quite easy (we don't need any dart library). I was just asking for a complete list of units that should be displayed with fractions (e.g. inches, feet, etc.)

trymeouteh commented 2 years ago

Length & Area Inches Feet

Mass Pounds Ounces

More could be done but these are probably the most used in fractions, especially the inches and feet for things like carpentry.

ferraridamiano commented 2 years ago

It is better to have a complete list of units. I'm not used to imperial units so, if you can help, when we implement this feature it will be complete