Formatting Numbers correctly

In my query I have the following:

sum(T1.RoomTotal)

I have been trying, unsuccessfully, to format this number as either to 2 decimal places OR as an integer value. I’ve tried using math.floor() and mathround() for the integer, i.e.,

math.floor(sum(T1.RoomTotal))
math.round(sum(T1.RoomTotal))

and for the decimal number

number.toFixed(sum(T1,RoomTotal),2)

but none of these work and in fact, stop the query running successfully in that no results show.

Obviously I am using the wrong function or positioning it incorrectly so if somebody could correct me, I would be very grateful. TIA

here’s a link that gives you easy access to syntax of various databases.

http://sqlzoo.net/howto/source/s.pl.htm?file=tip177276&e=postgres

Hi Michael,

Perhaps this thread may help you :

http://forum.servoy.com/viewtopic.php?t=2034&highlight=

Cheers

Harry

Thanks, Harry and Maarten for your responses.