Skip to content

Better fix for floating point weirdness in line item check

DaveD requested to merge DaveD/cdntaxreceipts:weird2 into master

The previous quickfix relies on php being weird and two wrongs making a right. This makes it more explicit we're only comparing 2 decimal places.

Backstory:

Where this came from was a contribution that had 3 line items with lucky numbers:

php -r "var_dump(16.03 + 14.06 + 617.32);"
float(647.4100000000001)

When it gets to the actual receipt, it chops it to 2 decimal places before writing so the wackiness goes away, but the line_item check wasn't doing that.

Merge request reports

Loading