Skip to content

Instantly share code, notes, and snippets.

@martinusso
Created September 30, 2011 14:22
Show Gist options
  • Save martinusso/1253876 to your computer and use it in GitHub Desktop.
Save martinusso/1253876 to your computer and use it in GitHub Desktop.
Rounding numbers in Firebird
cast(cast(9223373.03685 as double precision) * cast(1.0000000000 as double precision) as numeric(18, 0)) as round_number
@martinusso
Copy link
Author

You can also avoid using the "cast" out of the calculation. Can usually use the ROUND and TRUNC functions.

round(cast(9223373.03685 as double precision) * cast(1.0000000000 as double precision)) as round_number

trunc(cast(9223373.03685 as double precision) * cast(1.0000000000 as double precision)) as truncated_number

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment