Convert a hexadecimal fraction to a decimal fraction.
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
test
.babelrc
.gitignore
.travis.yml
LICENSE
README.md
package.json

README.md

hex-frac-dec-frac

Convert a hexadecimal fraction to a decimal fraction.

This is different from hexToDec from libraries like all-your-base (as I just learned).

I use this for xkcd Geohashing.

NPM Build Status js-standard-style

Install

npm install hex-frac-dec-frac

Usage

import hexToDec from 'hex-frac-dec-frac'

hexToDec('a1e189f4df975ee2') === 0.6323477003894289
hexToDec('0baed468ae66bbd2') === 0.04563643985457139

Contributing

This is written in ES6 and compiled to ES5 using babel. The code you require will come from the lib/ directory which gets compiled from src/ before each npm publish.

Tests

npm test

TODO

  • Understand how this works and how its different from all-your-base

License

MIT