Class: EngineNumber

EngineNumber(value, units, originalString)

Representation of a number with units within the engine.

Constructor

new EngineNumber(value, units, originalString)

Create a new number with units.
Parameters:
Name Type Description
value The numeric value (float, or int).
units The units to associate with this value like kg.
originalString Optional original string format to preserve user formatting.
Source:

Methods

getOriginalString() → {string|null}

Get the original string format if available.
Source:
Returns:
The original string format, or null if not available.
Type
string | null

getUnits()

Get the units associated with this number.
Source:
Returns:
The units as a string like "mt".

getValue()

Get the value of this number.
Source:
Returns:
Value as an integer or float.

hasEquipmentUnits() → {boolean}

Check if this number has equipment units.
Source:
Returns:
True if the units represent equipment units.
Type
boolean

hasOriginalString() → {boolean}

Check if this number has an original string format preserved.
Source:
Returns:
True if original string format is available.
Type
boolean