← trunc operator page · numeric/trunc/sc_placeholder/placeholder_for_digits

Placeholder for digits 🟢 all ok

pandas ✅ · DuckDB ✅

Tests:

the placeholder _ for numDigit, on a scalar: trunc(SC_1, _) with SC_1 = 12345.6.

Manual:

Truncation: "trunc ( 12345.6, _ ) gives 12345".

Expected:

SC_r = 12345, an Integer: the placeholder stands for an omitted numDigit.

script.vtl ⇩

SC_r := trunc(SC_1, _);

input/scalars.csv ⇩

SC_1
12345.6

input/scalars.json ⇩

{
  "scalars": [
    {"name": "SC_1", "type": "Number"}
  ]
}

expected/scalars.json ⇩

{
  "scalars": [
    {
      "name": "SC_r",
      "type": "Integer",
      "value": "12345"
    }
  ]
}