linear-preset-any-to-any
v3.0.3
Published
Generate linear presets for any to any conversions
Downloads
15
Readme
linear-preset-any-to-any
Generate linear presets for any to any conversions
Install
npm i linear-preset-any-to-any
Usage
var Decimal = require('linear-arbitrary-precision')(require('floating-adapter'));
var anyToAny = require('linear-preset-any-to-any')(Decimal);
var temp = require('linear-presets-temperature').conversions;
// all numbers are Decimal
anyToAny(temp, 'kelvin', 'fahrenheit'); // => [[273.15, 373.15], [32, 212]]
anyToAny(temp, 'celsius', 'fahrenheit'); // => [[0, 100], [32, 212]]
anyToAny(temp, 'fahrenheit', 'celsius'); // => [[32, 212], [0, 100]]
anyToAny(temp, 'celsius', 'celsius'); // => [[0, 1], [0, 1]]
Related projects
- linear-presets: linear presets for common units.
- linear-converter: flexible linear converter.