--- title: "round(a, b)" slug: "math-round-to-digits" updated: 2026-08-13T13:17:40Z published: 2026-08-13T13:17:40Z canonical: "docs.lobstersoftware.com/math-round-to-digits" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.lobstersoftware.com/llms.txt > Use this file to discover all available pages before exploring further. # round(a, b) This function rounds numerical value **a** to the nearest double value with **b** digits after the decimal separator. Since this function uses double values internally, rounding errors may occur. Use function round(bigdecimal a, b) to avoid this. If **a** is not a numerical value, the function returns *0.0*, see examples below. ## Parameters | Parameter | Description | | --- | --- | | a | Numerical value. | | b | Number of decimal places in resulting value. | ## Examples | Parameter a | Parameter b | Result | | --- | --- | --- | | 2.135 | 0 | 2 | | 2.135 | 1 | 2.1 | | 2.135 | 2 | 2.14 | | abc | 2 | 0.0 |