← trunc operator page · numeric/trunc/ds_no_digits/two_number_measures
pandas ✅ · DuckDB ✅
trunc with numDigit omitted, on a dataset with two Number measures.
Truncation: "The basic scalar type of the result is integer if numDigit is omitted"; the result is typed dataset { measure<number> _+ }, and the unary operators give "homonymous Measures in DS_r".
both measures keep their names and become Integers: Me_1 3, 2 and 7, Me_2 12345, 0 and 5. Ceiling and Floor Example 1 do the same, and nothing puts trunc among the "Operators changing the data type", which allow one measure only.
DS_r := trunc(DS_1);
| Id_1 | Me_1 | Me_2 |
|---|---|---|
| 1 | 3.14159 | 12345.6 |
| 2 | 2.71828 | 0.4 |
| 3 | 7.2 | 5.9 |
{
"datasets": [
{
"name": "DS_1",
"DataStructure": [
{"name": "Id_1", "type": "Integer", "role": "Identifier", "nullable": false},
{"name": "Me_1", "type": "Number", "role": "Measure", "nullable": true},
{"name": "Me_2", "type": "Number", "role": "Measure", "nullable": true}
]
}
]
}
| Id_1 | Me_1 | Me_2 |
|---|---|---|
| 1 | 3 | 12345 |
| 2 | 2 | 0 |
| 3 | 7 | 5 |
{
"datasets": [
{
"name": "DS_r",
"DataStructure": [
{"name": "Id_1", "type": "Integer", "role": "Identifier"},
{"name": "Me_1", "type": "Integer", "role": "Measure"},
{"name": "Me_2", "type": "Integer", "role": "Measure"}
]
}
]
}