diff options
Diffstat (limited to 'stdnum/nl/bsn.py')
-rw-r--r-- | stdnum/nl/bsn.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/stdnum/nl/bsn.py b/stdnum/nl/bsn.py index e73dda3..c702b77 100644 --- a/stdnum/nl/bsn.py +++ b/stdnum/nl/bsn.py @@ -30,11 +30,13 @@ False '1112.22.333' """ +from stdnum.util import clean + def compact(number): """Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.""" - number = number.replace(' ', '').replace('-', '').replace('.', '').strip() + number = clean(number, ' -.').strip() # pad with leading zeroes return (9 - len(number)) * '0' + number |