Skip to content

Commit

Permalink
fixes #22'
Browse files Browse the repository at this point in the history
  • Loading branch information
niknow committed Aug 27, 2015
1 parent ab2760e commit bc68ace
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions geolocation/distance_matrix/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ def distance(self, value):
model = Distance()

if value:
pattern = r'(?P<value>[\d,]+)\s(?P<unit>km|m)$'
pattern = r'(?P<value>[\d,.]+)\s(?P<unit>km|m)$'

unit = re.match(pattern, value).group('unit')
value = re.match(pattern, value).group('value').replace(',', '').replace('.', ',')
value = re.match(pattern, value).group('value').replace(',', '')

if unit == const.UNIT_KM:
model.kilometers = float(value)
Expand Down

0 comments on commit bc68ace

Please sign in to comment.