Absolute value in vb.net

Cyclone picture Cyclone · Sep 2, 2009 · Viewed 29.3k times · Source

How do you get the absolute value of a number in vb.net?

Is there a function built in? I know I can simply code a function myself, but I want to know if there is one already there first. It seems so simple, I could probably make it in three lines, so I would be surprised if there isnt one....

Thanks!

Answer

Alex Papadimoulis picture Alex Papadimoulis · Sep 2, 2009

Math.Abs( val )

MSDN Link