Skip to content

Commit

Permalink
Merge pull request joke2k#280 from wybiral/fix/master/253
Browse files Browse the repository at this point in the history
Fixed geo_coordinate Decimal issue joke2k#253
  • Loading branch information
fcurella committed Aug 24, 2015
2 parents 0660581 + 88bd5fb commit d08fd3d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion faker/providers/address/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,10 @@ def geo_coordinate(cls, center=None, radius=0.001):
if not center:
return Decimal(str(random.randint(-180000000, 180000000) / 1000000.0)).quantize(Decimal('.000001'))
else:
center = float(center)
radius = float(radius)
geo = random.uniform(center - radius, center + radius)
return Decimal(str(geo))
return Decimal(str(geo)).quantize(Decimal('.000001'))

@classmethod
def latitude(cls):
Expand Down

0 comments on commit d08fd3d

Please sign in to comment.