Advanced Rounding
roundAdjust numeric precision with four methods: nearest (standard), floor (down), ceil (up), trunc (toward zero). Specify decimals and accept single or list values.
Instructions
Advanced rounding operations with multiple methods.
Methods: - round: Round to nearest (3.145 → 3.15 at 2dp) - floor: Always round down (3.149 → 3.14) - ceil: Always round up (3.141 → 3.15) - trunc: Truncate towards zero (-3.7 → -3, 3.7 → 3)
Examples:
ROUND TO NEAREST: values=3.14159, method="round", decimals=2 Result: 3.14
FLOOR (DOWN): values=3.14159, method="floor", decimals=2 Result: 3.14
CEIL (UP): values=3.14159, method="ceil", decimals=2 Result: 3.15
MULTIPLE VALUES: values=[3.14159, 2.71828], method="round", decimals=2 Result: [3.14, 2.72]
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| context | No | Optional annotation to label this calculation (e.g., 'Bond A PV', 'Q2 revenue'). Appears in results for easy identification. | |
| output_mode | No | Output format: full (default), compact, minimal, value, or final. See batch_execute tool for details. | full |
| values | Yes | Single value or list (e.g., 3.14159 or [3.14, 2.71]) | |
| method | No | Rounding method | round |
| decimals | No | Number of decimal places |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |