I currently have this in my controller:
@softwares = Software.find_by_sql
(
"SELECT s.id, s.vendor, s.title, s.edition, SUM(l.amount) AS amount FROM softwares s
LEFT JOIN licenses l ON s.id=l.software_id GROUP BY s.vendor, s.title, s.edition"
)
Which does what it’s supposed to, but the number comes up as 7.0 or 6.0 instead of just 7 or 6.. how do i remove the decimal? In my view i literally just have <%= l.amount %>
It comes up as a decimal because l.amount is a decimal
try