Swift - `Scale Number in a Range min - max -


how can scale number fit in specified range? example if have:

input_min = 10.1; input_max = 750.0;  range_min = 0.0; range_max = 350.0;  example input_n = 503.9; 

how can make number scale in range min , max using swift?

func converttorange(number: double) -> double {     return (number - 10.1) / (750.0 - 10.1) * 350 } 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -