1.0.5 • Published 5 years ago

@almcd/mapnumericalrange v1.0.5

Weekly downloads
6
License
MIT
Repository
github
Last release
5 years ago

mapnumericalrange

npm (scoped) npm bundle size (scoped)

Re-maps a number from one range to another.

Install

$ npm install @almcd/mapnumericalrange

Syntax

mapNumericalRange(value, start1, stop1, start2, stop2);

Parameters

value Number: the value to be converted

start1 Number: the lower bound of the value's current range

stop1 Number: the upper bound of the value's current range

start2 Number: the lower bound of the value's target range

stop2 Number: the upper bound of the value's target range

Usage

const mapNumericalRange = require("@almcd/mapnumericalrange");

mapNumericalRange(25, 0, 100, 500, 1000);
//=> 625
1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago