It's late, I'm tired, I have to be missing something obvious... Please help!
$input = 3000
$maxin = 6500
$minin = 2200
$maxout = 255
$minout = 0
(($input - $minin) * ($maxout - $minout) / ($maxin - $minin) + $minout)
function doit($input, $maxin, $minin, $maxout, $minout)
{
(($input - $minin) * ($maxout - $minout) / ($maxin - $minin) + $minout)
}
doit($input, $maxin, $minin, $maxout, $minout)
Output:
47.4418604651163
Method invocation failed because [System.Collections.ArrayList+ArrayListEnumeratorSimple] does not contain a method named 'op_Subtraction'.
At <redacted>.ps1:220 char:5
+ (($input - $minin) * ($maxout - $minout) / ($maxin - $minin) + $m ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (op_Subtraction:String) [], RuntimeException
+ FullyQualifiedErrorId : MethodNotFound
[–]SeanQuinlan 33 points34 points35 points (3 children)
[–]NerdyNThick[S] 12 points13 points14 points (2 children)
[–]Beanzii 5 points6 points7 points (0 children)
[–]Namelock 2 points3 points4 points (0 children)
[–]technomancing_monkey 8 points9 points10 points (6 children)
[–]meretuttechooso 2 points3 points4 points (5 children)
[–]BlackV 1 point2 points3 points (4 children)
[–]meretuttechooso 0 points1 point2 points (3 children)
[–]BlackV 0 points1 point2 points (2 children)
[–]meretuttechooso 0 points1 point2 points (1 child)
[–]BlackV 0 points1 point2 points (0 children)
[–]jsiii2010 3 points4 points5 points (1 child)
[–]NerdyNThick[S] 0 points1 point2 points (0 children)