Skip to content

Convert millimeters to inches with fractions based on 64 denominator

License

Notifications You must be signed in to change notification settings

vasco3/mminch-64

Repository files navigation

mminch-64

mminch-64

Known Vulnerabilities

Convert millimeters to inches with fractions based on 64 denominator.

About

This library covers a specific need for practical need. People aren't used to think of inches as decimals. They understand them better in fractions. They want to see them as fractions of 64ths like they would in an inch ruler. There are many inch-to-millimeters tables like http://www.hamuniverse.com/antfrac.html that stress the importance of having inches as fractions.

Disclaimer

You might say that 3/64 inch is 1.1906mm. But to keep rounding simple and to be consistent on the conversion from mm to inches and inches to mm, it rounds millimeters to the nearest half eg. 1/4 in ~ 6.5mm or 3/64 in ~ 1mm. This rounding can cause trouble with fractions that are close to each other like 1/4 and 17/64 or with 3/16 and 13/64. Due to mismatch from fractions to decimals, the results are slightly off in most cases due to rounding.

This tool is meant to be for a practical use case and not a precise millimetrical use case. This is commonly found in industries like construction and engineering when they are talking about rough estimates. That means that this library can't be replaced by the numbers 0.0393701, or if you want /64ths, 2.51968504.

By no means use this library as an exact conversion tool for projects that require ultimate precision. By doing so you run the risk of losing millions of dollars like a hand-ful of NASA projects.

Shout out to ugwe43to874nf4 for pointing out some of the potential flaws of this library under an incorrect use.

Install

From npm

npm install --save mminch-64

From the browser

<script src="https://npmcdn.com/mminch-64@2.1.0"></script>

Usage

Convert mm to inches

  mminch(1).toInch() // '3/64'

Convert inches to mm

  mminch('3/64').toMM() // '1'

Convert inches to feet

  mminch('12').toFeet() // '1'

Supported conversions

  • mm to in
  • in to mm
  • in to feet

About

Convert millimeters to inches with fractions based on 64 denominator

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published