set replace_dots default value to False
This commit is contained in:
parent
a434f33a61
commit
09b0de545e
1 changed files with 6 additions and 1 deletions
|
|
@ -291,6 +291,11 @@ class CleanDecimal(CleanText):
|
||||||
"""
|
"""
|
||||||
Get a cleaned Decimal value from an element.
|
Get a cleaned Decimal value from an element.
|
||||||
|
|
||||||
|
replace_dots is False by default. A dot is interpreted as a decimal separator.
|
||||||
|
|
||||||
|
If replace_dots is set to True, we remove all the dots. The ',' is used as decimal
|
||||||
|
separator (often useful for French values)
|
||||||
|
|
||||||
If replace_dots is a tuple, the first element will be used as the thousands separator,
|
If replace_dots is a tuple, the first element will be used as the thousands separator,
|
||||||
and the second as the decimal separator.
|
and the second as the decimal separator.
|
||||||
|
|
||||||
|
|
@ -301,7 +306,7 @@ class CleanDecimal(CleanText):
|
||||||
>>> CleanDecimal('./td[1]', replace_dots=(',', '.')) # doctest: +SKIP
|
>>> CleanDecimal('./td[1]', replace_dots=(',', '.')) # doctest: +SKIP
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, selector=None, replace_dots=True, default=_NO_DEFAULT):
|
def __init__(self, selector=None, replace_dots=False, default=_NO_DEFAULT):
|
||||||
super(CleanDecimal, self).__init__(selector, default=default)
|
super(CleanDecimal, self).__init__(selector, default=default)
|
||||||
self.replace_dots = replace_dots
|
self.replace_dots = replace_dots
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue