mirror of
https://gitlab.com/datalifeit/python-retrofix
synced 2023-12-14 06:13:03 +01:00
Fix numerics with 0 decimals
This commit is contained in:
parent
4a169fe696
commit
997cd8c18e
1 changed files with 4 additions and 1 deletions
|
@ -172,7 +172,10 @@ class Numeric(Field):
|
|||
if self._sign in (SIGN_12, SIGN_N):
|
||||
sign = -1 if value[0] in ('1', 'N') else 1
|
||||
value = value[1:]
|
||||
num = sign * Decimal('%s.%s' % (value[:-self._decimals],
|
||||
if not self._decimals:
|
||||
num = sign * Decimal(value)
|
||||
else:
|
||||
num = sign * Decimal('%s.%s' % (value[:-self._decimals],
|
||||
value[-self._decimals:]))
|
||||
return num
|
||||
|
||||
|
|
Loading…
Reference in a new issue