I have float number 2.11.
How do I get the absolute value for this number?
Code:Dim av As String
av = Abs(2.11) <= 0.0005
Printable View
I have float number 2.11.
How do I get the absolute value for this number?
Code:Dim av As String
av = Abs(2.11) <= 0.0005
I'm a bit confused by what you mean, my understanding of an absolute value is just the value without sign i.e. AbsoluteValue = Abs(number)
What do you mean?
I have floating number 2.11 . In the field name it showed 2.11.. But absolutely it mybe 2.11324.. So I want to get the value after 2.11
Abs(2.11 <= 0.0005)
There's some confusion here. The Abs Function returns the unsigned magnitude of the argument. eg Abs(-1) = 1, Abs(1) = 1.
You can adjust the number of decimal places displayed via the Format statement eg Debug.Print Format(sngNumber, "0.0000")
Note also that most floating-point data types (such as Single and Double) do not store data accurately.
It is possible that a number like 2.11324 would actually be stored as just 2.11, and if so there is no way to get the extra precision back.
If you want floating-point numbers with accuracy, try using the Currency data type instead.