Skip to main content

system.mes.unitOfMeasure.convert

Description

Converts the specified amount from one unit of measure to the other.

Syntax

system.mes.unitOfMeasure.convert(amount, from, to)
system.mes.unitOfMeasure.convert(amount, from, to, materialIdOrPath)

Parameters

ParameterTypeDescription
amountDoubleThe amount to convert.
fromStringThe ULID or name of the from unit of measure to check.
toStringThe ULID or name of the to unit of measure to check.
materialIdOrPathStringThe ULID or path of the material associated with the conversion.

Returns

Returns the amount converted.

Example Usage

# Convert the specified amount from one unit of measure to the other.
converted_amount = system.mes.unitOfMeasure.convert(100, 'Pound', 'Kg')

# Output the amount converted to new unit of measure
print(converted_amount)