Created
May 15, 2019 08:21
-
-
Save florinpop17/07d1d9e7f9a65b50561b9cb178c7caf6 to your computer and use it in GitHub Desktop.
Countdown React - mapNumber
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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