Skip to content

Instantly share code, notes, and snippets.

@florinpop17
Created May 15, 2019 08:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save florinpop17/07d1d9e7f9a65b50561b9cb178c7caf6 to your computer and use it in GitHub Desktop.
Save florinpop17/07d1d9e7f9a65b50561b9cb178c7caf6 to your computer and use it in GitHub Desktop.
Countdown React - mapNumber
function mapNumber(number, in_min, in_max, out_min, out_max) {
return (
((number - in_min) * (out_max - out_min)) / (in_max - in_min) + out_min
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment