round.asciidoc 783 B

12345678910111213141516171819202122232425262728293031323334
  1. [discrete]
  2. [[esql-round]]
  3. === `ROUND`
  4. *Syntax*
  5. [.text-center]
  6. image::esql/functions/signature/round.svg[Embedded,opts=inline]
  7. *Parameters*
  8. `value`::
  9. Numeric expression. If `null`, the function returns `null`.
  10. `decimals`::
  11. Numeric expression. If `null`, the function returns `null`.
  12. *Description*
  13. Rounds a number to the closest number with the specified number of digits.
  14. Defaults to 0 digits if no number of digits is provided. If the specified number
  15. of digits is negative, rounds to the number of digits left of the decimal point.
  16. include::types/round.asciidoc[]
  17. *Example*
  18. [source.merge.styled,esql]
  19. ----
  20. include::{esql-specs}/docs.csv-spec[tag=round]
  21. ----
  22. [%header.monospaced.styled,format=dsv,separator=|]
  23. |===
  24. include::{esql-specs}/docs.csv-spec[tag=round-result]
  25. |===