[RESOLVED] mySQL - divide giving too many decimal points

I am outputting a value that is based on a division, using:

SUM(Cost_per_PAX_UNit * PAX_Unit) / 100 AS itinerary_commission

This works, and gives me the correct value, but has six decimal points, e.g. 72.725000

Multiply only gives two decimal points, but it may be to do with the divide value not knowing to round up or down, e.g. to 72.72 or 72.73.

The rounding isn’t really too important either way, but is there a way to get it to display just two decimal places?

Think I have it:

ROUND (SUM(Cost_per_PAX_UNit * PAX_Unit) / 100, 2)
3 Likes

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.