New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

iobroker-adapter-helpers

Package Overview
Dependencies
Maintainers
23
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

iobroker-adapter-helpers

Some helper files

latest
Source
npmnpm
Version
0.0.8
Version published
Weekly downloads
123
-13.99%
Maintainers
23
Weekly downloads
 
Created
Source

iobroker-adapter-helpers

Some helper files

Usage of units and exponents:

Every unit has a base, this base has the exponent 0. Example meter: {"unit": "m", "exponent": 0}

With the exponent it is simple to convert the given unit in to a higher or lower unit.

This conversion is done with the function Math.pow(10, exponent).

const value = 1000          //unit mm
const baseExp = -3;         //exponent for mm
const expectedExp = -2;     //exponent for cm

console.log( ( value * Math.pow( 10, (baseExp - expectedExp) ) + ' cm' ); //output 100 cm

FAQs

Package last updated on 02 Sep 2020

Related posts