You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`isInteger()`| bool | returns true if and only if asInteger is safe to call without an error |
220
+
|`asInteger()`| int | returns a representation of the current value as an int64 if possible or results in an error if conversion would result in overflow or loss of precision. |
221
+
|`asApproximateFloat()`| float | returns a float64 representation of the quantity which may lose precision. If the value of the quantity is outside the range of a float64 +Inf/-Inf will be returned. |
222
+
|`sign()`| int | Returns `1` if the quantity is positive, `-1` if it is negative. `0` if it is zero |
223
+
|`add(<Quantity>)`| Quantity | Returns sum of two quantities |
224
+
|`add(<int>)`| Quantity | Returns sum of quantity and an integer |
225
+
|`sub(<Quantity>)`| Quantity | Returns difference between two quantities |
226
+
|`sub(<int>)`| Quantity | Returns difference between a quantity and an integer |
227
+
|`isLessThan(<Quantity>)`| bool | Returns true if and only if the receiver is less than the operand |
228
+
|`isGreaterThan(<Quantity>)`| bool | Returns true if and only if the receiver is greater than the operand |
229
+
|`compareTo(<Quantity>)`| int | Compares receiver to operand and returns 0 if they are equal, 1 if the receiver is greater, or -1 if the receiver is less than the operand |
230
+
{{< /table >}}
231
+
232
+
Examples:
233
+
234
+
{{< table caption="Examples of CEL expressions using URL library functions" >}}
0 commit comments