Answers for "c# map number range"

C#
0

c# map number range

public static class ExtensionMethods
{
    public static decimal Map (this decimal value, decimal fromSource, decimal toSource, decimal fromTarget, decimal toTarget)
    {
        return (value - fromSource) / (toSource - fromSource) * (toTarget - fromTarget) + fromTarget;
    }
}
Posted by: Guest on February-04-2022

C# Answers by Framework

Browse Popular Code Answers by Language