Socket
Socket
Sign inDemoInstall

iobroker-adapter-helpers

Package Overview
Dependencies
0
Maintainers
23
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    iobroker-adapter-helpers

Some helper files


Version published
Weekly downloads
95
decreased by-2.06%
Maintainers
23
Install size
70.5 kB
Created
Weekly downloads
 

Readme

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

Last updated on 02 Sep 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc