ZeroToNull(), Zn()

Summary

Converts a zero numeric value to null.

Changes

Handling of epsilon changed in Version 5.0.

Syntax

new_value = ZeroToNull(real old_value, real epsilon)

Argument Contents
old_value The numeric value to convert
epsilon If not null, the allowable difference from zero

Returns

A new value equal to old_value if old_value is not zero or within epsilon of zero, otherwise null.

Notes

  • Can also be called as Zn().

  • If an epsilon value is used, values within +/- epsilon of zero are considered to be zero.

  • In Version 5.0, a missing epsilon value implies that only exact zeros will be converted to nulls. In previous versions, a missing epsilon value implied that any value would be converted to null.

Example

testval = 0.001
fixval1 = ZeroToNull(testval, 0.01) // fixval1 = null
fixval2 = Zn(testval, ) // fixval2 = 0.001

See Also

Function Summary
NullToZero() Converts a null numeric value to zero