← cast operator page · general/cast/integer_to_number/zero_decimal_part
pandas ✅ · DuckDB ✅
cast(Me_1, number) on an Integer measure, an implicit conversion written as an explicit cast, whose "behavior remains the same".
Type conversion: "From integer to number: a number value is returned having the integer part equal to the integer value, and the decimal part equal to zero."
5 gives 5.0 and -3 gives -3.0.
DS_r := DS_1[calc Me_2 := cast(Me_1, number)];
| Id_1 | Me_1 |
|---|---|
| 1 | 5 |
| 2 | -3 |
{
"datasets": [
{
"name": "DS_1",
"DataStructure": [
{"name": "Id_1", "type": "Integer", "role": "Identifier", "nullable": false},
{"name": "Me_1", "type": "Integer", "role": "Measure", "nullable": true}
]
}
]
}
| Id_1 | Me_1 | Me_2 |
|---|---|---|
| 1 | 5 | 5.0 |
| 2 | -3 | -3.0 |
{
"datasets": [
{
"name": "DS_r",
"DataStructure": [
{"name": "Id_1", "type": "Integer", "role": "Identifier"},
{"name": "Me_1", "type": "Integer", "role": "Measure"},
{"name": "Me_2", "type": "Number", "role": "Measure"}
]
}
]
}