Skip to content

pelevesque-node/scale-number

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Coverage Status JavaScript Style Guide

scale-number

Scales a number within a range.

Node Repository

https://www.npmjs.com/package/@pelevesque/scale-number

Installation

npm install @pelevesque/scale-number

Tests

Command Description
npm test or npm run test All Tests Below
npm run cover Standard Style
npm run standard Coverage
npm run unit Unit Tests

Usage

const scaleNumber = require('@pelevesque/scale-number')
const num = 10
const oldRangeMin = 0
const oldRangeMax = 100
const newRangeMin = 0
const newRangeMax = 1000
const result = scaleNumber(num, oldRangeMin, oldRangeMax, newRangeMin, newRangeMax)
// result === 100

About

Scales a number within a range.

Resources

License

Stars

Watchers

Forks

Packages

No packages published