Skip to content

Commit

Permalink
Merge pull request #21 from khanxmetu/patch-1
Browse files Browse the repository at this point in the history
Correct conversion of float to string
  • Loading branch information
pudo authored Jan 9, 2025
2 parents 8073d8e + 0eccad1 commit 6b50457
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion normality/stringify.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ def stringify(
return _clean_empty(value)
if isinstance(value, (date, datetime)):
return value.isoformat()
elif isinstance(value, (float, Decimal)):
elif isinstance(value, float):
return str(value)
elif isinstance(value, Decimal):
return Decimal(value).to_eng_string()
elif isinstance(value, bytes):
if encoding is None:
Expand Down

0 comments on commit 6b50457

Please sign in to comment.