Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
print can show unbalanced transactions with a commodity directive #931
This frequently annoys me when I need to re-parse print's output, eg when doing a query that requires a pipeline. Time to do something about it.
print shows an unbalanced transaction:
which can not be re-parsed:
PS, a use case to justify this: fractions of a cent don't typically arise in day to day transactions, but they do arise eg when splitting shared expenses according to some rule, eg splitting an odd amount 50-50.
You can work around it by putting the extra cent on one amount or the other, but this requires thought and manual intervention and can cause disagreement with external systems - I would rather use the correct mathematical split.
You can also work around it by temporarily commenting out the commodity directive to allow unlimited display precision. But this is manual and annoying (and now all dollar amounts are rendered with three decimal places).