← trunc operator page · numeric/trunc/sc_comp_digits/digits_from_component
pandas ✅ · DuckDB ✅
a scalar operand with numDigit given by an Integer component, inside calc.
Truncation types numDigit as component<integer> | integer, so it may be a component while the operand is a scalar.
the error 1-1-15-8, "At op {op}: {op} operator cannot have a {comp_type} as parameter": by a team decision, numDigit is a Component only when the operand is a Component too.
DS_r := DS_1[calc Me_2 := trunc(3.14159, Me_1)];
| Id_1 | Me_1 |
|---|---|
| 1 | 2 |
| 2 | 4 |
| 3 | 0 |
{
"datasets": [
{
"name": "DS_1",
"DataStructure": [
{"name": "Id_1", "type": "Integer", "role": "Identifier", "nullable": false},
{"name": "Me_1", "type": "Integer", "role": "Measure", "nullable": true}
]
}
]
}
{"code": "1-1-15-8"}