1.1.0 • Published 12 months ago

normalized-number v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

normalized-number

Rescales a number (min-max normalization). Read more on wikipedia

Features

  • works in browser and nodejs
  • ts support
  • super tiny
  • dependencies free

Installation

npm i normalized-number

Usage

normalizedNumber({
    sourceValue: 50,
    sourceRange: [0, 100],
    targetRange: [0, 1],
}); // 0.5

normalizedNumber({
    sourceValue: 2,
    sourceRange: [1, 3],
    targetRange: [4, 6],
}); // 5

License

MIT

1.1.0

12 months ago

1.0.0

12 months ago