Zero configuration linear converter with floating precision.
npm i linear-converter-to-go
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.
- linear-converter: flexible linear converter.
- linear-presets: linear presets for common units.