interpolation of number in proportion function

hi i have a number that interpolates from 0 to 0.72
I would like to have interpolation funcion where 0.72 would return for some other varible =100,
when 0.71 return around 98 and that number would go to zero when that 0.72 would be going to zero

0<------->0.72

0<----------->100
is there any allready build in function? thx in advance

double Interpolate(double min, double max, double value)
{
return (value - min) / (max - min)
}

Where in your example, min = 0, max = 0.72, value = 0.71 and it should return 98.61111111.

If you want this to be a round integer, you can have the return type be an int, and use a floor, ceiling, or round function to get an integer.

in update
chwilowaLiczba=Interpolate(0,0.72,1);

function Interpolate(min:double, max:double,valuee:double)
{
valuee =(valuee - min) / (max - min);
return valuee;

It returns.1.3

function Interpolate(x:double)
{
x=100*(interpolatedNumber*10)/72;
return x;
}

but this works, 72 is range 0.72

Yeah, 1 is larger that .72… it’s 30% larger.

function Interpolate(multiculti:double,x:float)
{
x=100*(mojeG)/73;
multiculti=100-(x*100)+0.6;
multiculti.ToString("F2");
return multiculti;
}

in update
CountryMultiCultiLevel=Interpolate(0,0);
multiculty=CountryMultiCultiLevel.ToString(“F2”);

this will take interpolated value from 0 to 0.72 as mojeG, then its converted to 0 to 72 then it will Applay that change in interpolation in range 0,100, then its inverted for my own purpose the higher number in range 0,100 the lowest
CountryMultiCultiLevel. tested and it works

BTW 1 is larger than 72 by more then 30% of 72
0.3 is 30% from 1, 30% of 72=21—>72+21=93

Yeah, you must not have printed out the correct result. Because I just ran it and the formula spits back 1.388888…

Which it is.

I also have no idea what this means:

But hey, if it gets you what you need… have at it.

I dynamicly change one of values of Color(X,MyColor,X,X); variable MyColor is being interpolated from 0 to 0.72 dynamicly
I wanted to to use interpolation of value MyColor to interpolate the variable double “Multi_culti_level”
in range from 0 to 100 that would correspond to the change in MyColor variable

After it was achieved I inverted interpolation, so the bigger value of MyColor(0 to 0.72) the lower Multi_culti_level value from 0,100 is:) maybe what was written before was a bit unclear XD