Applying Absolute Value In VB.NET with ABS



VB.NET allows the conversion of figures (both positive and negative) into absolute figures easily. You can use the Mathematical Function as shown below

Math.ABS


For example, to change a figure value of -34167 into absolute figures, we can apply the codes as follows :


Dim myValue as Integer

myValue = Math.ABS(-34167)

MsgBox(myValue) 'The output now becomes 34167



That illustrates the use of the in-built Math.Abs function in VB.NET

0 comments