I have a number it could be negative or positive but I simply want to return the positive value.
-4 -> 4 5 -> 5
I know I can do a sim
Yet another way with Math.CopySign:
var negativeNum = -5; var positiveNum = Math.CopySign(negativeNum, 1); // 5