next-power-of-ten

v0.1.0
Returns the nearest next power of ten

next-power-of-ten

A function that returns the next power of 10 (counting up).

Install

$ npm install next-power-of-ten

Usage

var nextPowerOfTen = require( 'next-power-of-ten' );

nextPowerOfTen( 0 ); // 1
nextPowerOfTen( 10 ); // => 10
nextPowerOfTen( 57 ); // => 100
nextPowerOfTen( -57 ); // => -10
nextPowerOfTen( 570 ); // => 1000
nextPowerOfTen( -957 ); // => -100 
npm i next-power-of-ten

Metadata

  • MIT
  • Whatever
  • Seth Bonnie
  • released 7/13/2015

Downloads

Maintainers