Skip to main content
Version: V2 (Ignition 8.1)

tamaki.mes.backup.compare.equalValues

Description

Compares two scalar values for equality with some tolerance for numbers:

  • If both values are numeric, they are considered equal when isClose reports them close.
  • Otherwise the function attempts to coerce both values to floats and compare them with isClose (so "1.0" and 1 compare equal).
  • If coercion fails and the values are of different types, they are not equal.
  • Otherwise standard equality (==) is used.

This function is intended for scalar values and does not compare lists or dictionaries well.

Syntax

tamaki.mes.backup.compare.equalValues(oldValue, newValue)

Parameters

ParameterTypeNullableDescription
oldValueObjectTrueThe first value.
newValueObjectTrueThe second value.

Returns

A Boolean: True if the values are considered equal, otherwise False.

Code Examples

print(tamaki.mes.backup.compare.equalValues("1.0", 1)) # True
print(tamaki.mes.backup.compare.equalValues("a", "b")) # False