number
relationalai.semantics.std.numbers
number(value: NumberValue, precision: int = 38, scale: int = 14) -> VariableCreate an expression that represents a number with specified value, precision and scale.
Parameters
Section titled “Parameters”
(valueNumberValue) - The numeric value.
(precisionint, default:38) - The precision (total number of digits).
(scaleint, default:14) - The scale (number of decimal places).
Returns
Section titled “Returns”Variable- AVariablerepresenting the number with the specified properties. ReturnsNumber.
Examples
Section titled “Examples”Create a number with custom precision and scale:
>>> numbers.number(123.456, precision=10, scale=3)>>> numbers.number(Product.price, precision=12, scale=2)Referenced By
Section titled “Referenced By”RelationalAI Documentation └── Build With RelationalAI └── Understand how PyRel works > Use advanced reasoning > Rules-based reasoning └── Work with numbers └── Cast numeric values