Method: Abs for VBS
- 已更新2024-09-12
- 閱讀時間為 1 分鐘
Methods > Method: Abs for VBS
Method: Abs for VBS
Calculates the absolute value of a number.
vAbs = Object.Abs(number)
| Object | VBS Object with this method. You do not need to specify this object. |
| number | Variant Specifies any numeric expression. |
| vAbs | Variant Receives the absolute value. |
The following example calculates the absolute value of a number.
Call MsgBox(Abs(47.11)) ' Returns 47.11 Call MsgBox(Abs(-47.11)) ' Returns 47.11