LibreOffice 25.2 Help
ត្រឡប់តម្លៃដាច់ខាត នៃកន្សោមលេខមួយ ។
Abs (Number)
Double
ចំនួន ៖ កន្សោមលេខមួយចំនួន ដែលអ្នកចង់ត្រឡប់តម្លៃដាច់ខាត ។ ចំនួនវិជ្ជមានរួមទាំង ០ ត្រូវបានត្រឡប់ដោយគ្មានការផ្លាស់ប្តូរ ចំណែកឯចំនួនអវិជ្ជមានត្រូវបានបម្លែងទៅជាចំនួនវិជ្ជមាន ។
ឧទាហរណ៍ដូចខាងក្រោមប្រើអនុគមន៍ Abs ដើម្បីគណនាភាពខុសគ្នារវាងតម្លៃពីរ ។ វាគ្មានបញ្ហាទេ ថាតើអ្នកបញ្ចូលតម្លៃណាមុន ។
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