Posted on 2010-01-06
I am in the process of creating a trigger in a PostgreSQL database. I need to round the decimal number to the nearest quarter. For instance, 14.68 would be rounded to 14.75. We have a time and attendance system that round items to time and a half. The problem is that when it rounds the total time calculated for overtime it rounds it to an odd decimal such as 14.68. Our company policies dictate that these items be rounded to the nearest quarter of a decimal. The easiest way to do this is on the database end rather than editing the source code of the project. I need a PostgreSQL function that rounds the numbers past the decimal to the nearest .25. Any help would be greatly appreciated.