Community discussion forum

How to do division in postgresql without it being truncated?

  • 6 months ago

    Hello, my problem is how to do division in postgresql without it being truncated to an integer. The case here is: 3/2 should be 1.5 but the result is 1. I have checked the documentation and it says that the / operator truncates the result to an integer. So, is there another operator or function that does division without the result being truncated to an integer?

    Any help is greatly appreciated.

    Post was edited on 20/05/2009 05:30:37 Report abuse

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Want to stay in touch with what's going on? Follow us on twitter!