0

I am calculating an average in Firebird, and need only the whole number as a result. By using the "TRUNC" function I can get the number to display "99.000", but all I want is "99". I cannot find anything in the Firebird 3.0 language reference guide that describes how to get such a number to display. Is this even possible in Firebird?

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
  • Firebird does not display anything. Firebird is a server, it throws binary data in and out. It is your **database client application** which decides how to turn binary data into human readable text. There are some hacks to influence client apps behavior by altering binary formats, but they have limited effect and no warranties – Arioch 'The Nov 15 '20 at 22:01

1 Answers1

1

You can use cast():

select cast(val as int)

Alternatively, you can use floor():

select floor(val)
Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
Gordon Linoff
  • 1,242,037
  • 58
  • 646
  • 786