round.asciidoc 802 B

123456789101112131415161718192021222324252627282930313233343536
  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. *Supported types*
  17. include::types/round.asciidoc[]
  18. *Example*
  19. [source.merge.styled,esql]
  20. ----
  21. include::{esql-specs}/docs.csv-spec[tag=round]
  22. ----
  23. [%header.monospaced.styled,format=dsv,separator=|]
  24. |===
  25. include::{esql-specs}/docs.csv-spec[tag=round-result]
  26. |===