dahlia/iso4217

currency numbers with trailing zeroes returned with less than 3 digits

yevkrio opened this issue · 1 comments

Currency number should always contain 3 digits, however, in the case of currency that it's currency number starts with zeroes, the currency number that the module returns is less than 3 digits since the zeroes are omitted

for example:

Currency.bsd.number returns integer of 44 instead '044'

As the number property is int, whether to leave the leading zeros or not is inapplicable here. Anyway, you could try this:

>>> '%03d' % Currency.bsd.number  # Python 3.5 or below
'044'
>>> f'{Currency.bsd.number:03d}'  # Python 3.6 or above
'044'