Abs Function

Returns the absolute value of a numeric expression.

Syntax:


Day (číslo)

NĂĄvratovĂĄ hodnota:

Double

Paremetre:

Number: Any numeric expression that you want to return the absolute value for. Positive numbers, including 0, are returned unchanged, whereas negative numbers are converted to positive numbers.

NasledujĂșci prĂ­klad pouĆŸĂ­va funkciu Abs na vĂœpočet rozdielu medzi dvoma hodnotami. NezĂĄleĆŸĂ­ na tom, ktorĂș hodnotu zadĂĄte ako prvĂș.

Error codes:

5 NeplatnĂ© volanie procedĂșry

PrĂ­klad:


Sub ExampleDifference
Dim siW1 As Single
Dim siW2 As Single
    siW1 = Int(InputBox("Please enter the first amount","Value Input"))
    siW2 = Int(InputBox("Please enter the second amount","Value Input"))
    Print "The difference is "; Abs(siW1 - siW2)
End Sub

Please support us!