Logo
Home Cart [Log In] About Us Contact Us

Object Reference

xf_GeneralGeneral Functions

Public Function IsZeroAmt (
amt As Variant,
Optional threshold As Single = 0.095
) As Boolean

Check if the absolute value of the passed variable is within a given threshold of zero. This is used where accumulated rounding errors from floating point arithmetic causes a result that is very close to, but not quite zero, eg. 0.0001 In this case a zero check fails for the value. This function allows the zero check to be done.

amt as Variant

The value to be zero checked.

Optional threshold as Single = 0.095

The amount below which the value will be considered zero.

Call Template:

Dim b As Boolean
b = xf.Gen.IsZeroAmt(amt)
b = xf.Gen.IsZeroAmt(amt, threshold)

See Also:

Example 1:

IsZeroAmt(0.001)   => True
IsZeroAmt(0.1)     => False
Contact Us :: About Us :: Policies :: email: infspamo@arrospamw-of-tispamme.com    © 2012 Arrow Of Time Pty Ltd