AlternativeUnitsConvertTo
Qubes 11.0 Converts a quantity of an item from one unit to another, using direct, reversed, or transitive conversions.
Syntax
AlternativeUnitsConvertTo(itemGPAOID, srcUnit, destUnit, quantity)
Remarks
This function converts a quantity of an item from one unit to another. It handles direct conversions, reversed conversions, and transitive conversions through multiple intermediate units.
The function returns with one of these values:
- The converted quantity if the conversion is possible.
- "#ERR!" if the itemGPAOID is invalid or a recent error occurred.
- "#VAL!" if the conversion is not possible between the specified units.
- "#TMP!" temporarily as the data needs to be fetched from the server.
The function uses a caching mechanism to store conversion data and avoid unnecessary network requests. It also manages multiple concurrent requests for the same item efficiently.
Examples
AlternativeUnitsConvertTo("Flour", "kg", "bag", 10)
This call might return "#TMP!" initially. Once the data is fetched, it will return the converted value, for instance 2 if each bag of flour is 5 kg.