2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-15 03:25:42 +00:00

Merge remote-tracking branch 'inventree/master'

This commit is contained in:
Oliver Walters
2020-01-02 21:08:56 +11:00
4 changed files with 334 additions and 295 deletions

View File

@ -65,8 +65,19 @@ def decimal2string(d):
A string representation of the input number
"""
try:
# Ensure that the provided string can actually be converted to a float
float(d)
except ValueError:
# Not a number
return str(d)
s = str(d)
# Return entire number if there is no decimal place
if '.' not in s:
return s
return s.rstrip("0").rstrip(".")

File diff suppressed because it is too large Load Diff