← trunc operator page · numeric/trunc/ds_placeholder/placeholder_for_digits
pandas ✅ · DuckDB ✅
the placeholder _ for numDigit, on a dataset with one Number measure.
Truncation: "trunc ( 12345.6, _ ) gives 12345", and in the Typical behaviours, "Operators changing the data type", the measure whose type changes is replaced: "A default generic Measure is assigned by default to the result Data Set, depending on the data type of the result", int_var for an Integer.
the placeholder stands for an omitted numDigit, so the result is an Integer, as with trunc(DS_1): int_var 3, 2 and 12345.
DS_r := trunc(DS_1, _);
| Id_1 | Me_1 |
|---|---|
| 1 | 3.14159 |
| 2 | 2.71828 |
| 3 | 12345.6 |
{
"datasets": [
{
"name": "DS_1",
"DataStructure": [
{"name": "Id_1", "type": "Integer", "role": "Identifier", "nullable": false},
{"name": "Me_1", "type": "Number", "role": "Measure", "nullable": true}
]
}
]
}
| Id_1 | int_var |
|---|---|
| 1 | 3 |
| 2 | 2 |
| 3 | 12345 |
{
"datasets": [
{
"name": "DS_r",
"DataStructure": [
{"name": "Id_1", "type": "Integer", "role": "Identifier"},
{"name": "int_var", "type": "Integer", "role": "Measure"}
]
}
]
}