viafintech / camt_parser

A basic parser for camt.052, camt.053 and camt.054 files
MIT License
20 stars 24 forks source link

Return nil for missing amounts #22

Closed tobischo closed 5 years ago

tobischo commented 5 years ago

When no value is given for an amount field, we do not want to fail with an exception, as it is perfectly valid in camt files. Instead we want to return nil to make it clear that there is noving to convert into an integer or bigdecimal. That also prevents hiding that the value is missing, as would be the case in case of converting to 0/0.0 We cannot make an assumption about whether one needs to differentiate it however, checking for nil is possible and default to 0. If we already default to 0, that becomes impossible.

Refs #21