Yes, thanks! That’s exactly what I was looking for.
Although, I think I’ll use this for quantities, since besides showing only the significant decimals, it also formats the number according to the customer’s language: format_number(line.quantity, invoice.party.lang)