From 41dd8159b43e72f44f2e3ca0afcdeaac563b7180 Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Sat, 4 Feb 2012 19:15:00 +0000 Subject: 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 --- stdnum/nl/btw.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'stdnum/nl/btw.py') 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:] -- cgit v1.2.3