Trunc
Input
| value |
|---|
Truncate value to 2 decimal places
transformation:trunc
Truncate a number toward zero to N decimal places
source:value
parameters
- decimalPlaces
Number of decimal places to retain (0–20, default 0)
Output
| value |
|---|
| 3.14 |
| 2 |
| -1.67 |
| 0 |
| 999.99 |
| 0 |
Sample inputs run locally in your browser using the same operation logic as Fontana Flow.
Results are illustrative, not connected to a workflow.
Truncate a number toward zero to N decimal places.
Parameters
- decimalPlaces (Decimal Places, number, optional) — Number of decimal places to retain (0–20, default 0). Default:
0.
Field selection
- source — Field whose values this operation reads. Omit to apply to all fields on the row.
- target — Optional output field. When omitted, the source field is updated in place.
JSON Configuration
{ "id": "op-trunc", "type": "transformation", "action": "trunc", "params": { "decimalPlaces": 2 }, "testInputs": [ "3.14159", "2.005", "-1.678", "0.0049", "999.995", "-0.005" ]}