Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

map range of numbers to another range

const scale = (num, in_min, in_max, out_min, out_max) => {
  return (num - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: week days array in javascrpt 
Javascript :: redireccionar a una página con javascript 
Javascript :: jquery remove required attribute 
Javascript :: check if jquery is loaded 
Javascript :: jquery get current url 
Javascript :: alpine js cdn 
Javascript :: js https redirect 
Javascript :: Javascript get current year 
Javascript :: javascript detect escape key 
Javascript :: load lodash chrome console 
Javascript :: jquery if id exists 
Javascript :: adding jquery from console 
Javascript :: React version on CMD 
Javascript :: yup validate password confirmation 
Javascript :: js extract only numbers from string 
Javascript :: mongo atlas filter by array not empty 
Javascript :: user agent javascript 
Javascript :: javascript convert string to 2 decimal 
Javascript :: dynamics 365 javascript set disabled 
Javascript :: object json jquery foreach 
Javascript :: proper regex website url validation 
Javascript :: add id jquery 
Javascript :: js replace space with dash 
Javascript :: javacript contextmenu preventDefault 
Javascript :: get current formatted time in javascript 
Javascript :: decimal parse thousand separator javascript 
Javascript :: javascript get string between two parentheses 
Javascript :: remove square brackets from string javascript 
Javascript :: create react project 
Javascript :: javascript first and last day of the month 
ADD CONTENT
Topic
Content
Source link
Name
5+6 =