Temperature¶
Representation of a temperature. Returns objects created by amounts.
const { temperature } = require('abstract-things/values');
// With no unit - celsius is the default unit
const v = temperature(20);
console.log(v.value);
console.log(v.F); // convert to fahrenheit
console.log(v.celsius); // convert to celsius
// With a unit
console.log(temperature(50, 'F'));
// String (with our without unit)
console.log(temperature('220 K'));
Units¶
| Unit | SI | Names |
|---|---|---|
| Celsius | No | C, c, celsius |
| Kelvin | Yes | K, kelvin, kelvins |
| Fahrenheit | No | F, f, fahrenheit, fahrenheits |