Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/stdnum/nl/btw.py
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2012-02-04 20:15:00 +0100
committerArthur de Jong <arthur@arthurdejong.org>2012-02-04 20:15:00 +0100
commit41dd8159b43e72f44f2e3ca0afcdeaac563b7180 (patch)
treee86614d527fa123b84a6efdb097072cf488b1a65 /stdnum/nl/btw.py
parent54cc2079d50004c7d3c43fb4829cea7d509f0314 (diff)
implement a stdnum.util module for holding utility functions (for now clean())
git-svn-id: http://arthurdejong.org/svn/python-stdnum/python-stdnum@100 9dea7c4f-944c-4273-ac1a-574ede026edc
Diffstat (limited to 'stdnum/nl/btw.py')
-rw-r--r--stdnum/nl/btw.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/stdnum/nl/btw.py b/stdnum/nl/btw.py
index 33f2966..df924e3 100644
--- a/stdnum/nl/btw.py
+++ b/stdnum/nl/btw.py
@@ -28,12 +28,13 @@ False
"""
from stdnum.nl import bsn
+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('.', '').upper().strip()
+ number = clean(number, ' -.').upper().strip()
if number.startswith('NL'):
number = number[2:]
return bsn.compact(number[:-3]) + number[-3:]