linear-converter-to-go
v5.1.0
Published
Zero configuration linear converter with floating precision
Downloads
14
Readme
linear-converter-to-go
Zero configuration linear converter with floating precision.
Install
npm i linear-converter-to-go
Usage
See live playground.
var lc = require('linear-converter-to-go');
var temp = lc.PRESETS.temperature.conversions;
var cToF = lc.conversion(temp, 'celsius', 'fahrenheit');
lc.convert(cToF, 25).toFixed(3); // => '77.000'
// f(x) = 3x + 1
lc.convert([[0, 1], [1, 4]], 5); // => 16
Unlike linear-converter, linear-converter-to-go always returns primitive numbers.
See CodePen example.
For more documentation, see linear-converter.
Related projects
- linear-converter: flexible linear converter.
- linear-presets: linear presets for common units.