Skip to content

Commit

Permalink
Use max instead of if to require minimum precision
Browse files Browse the repository at this point in the history
  • Loading branch information
153957 committed Sep 2, 2024
1 parent 6df080b commit 21e85e0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions publicdb/raw_data/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -770,9 +770,8 @@ def clean_float_array(numbers, precision=5):
to support -999.
"""
if precision < 3:
# Unable to preserve -999 if precision less than 3.
precision = 3
# Unable to preserve -999 if precision less than 3.
precision = max(precision, 3)
return char.mod(f'%.{precision}g', numbers)


Expand Down

0 comments on commit 21e85e0

Please sign in to comment.