Skip to content

Commit

Permalink
Decrease precision
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubno committed Oct 23, 2024
1 parent 0509adf commit 6c8f6ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion template/startup_scripts/0002_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def _dynamic_round(number):
decimal_number = Decimal(str(number))

# Dynamically determine precision based on magnitude
precision = max(1, 16 - decimal_number.adjusted()) # 16 digits of precision
precision = max(1, 8 - decimal_number.adjusted()) # 8 digits of precision

with localcontext() as ctx:
ctx.prec = precision # Set the dynamic precision
Expand Down

0 comments on commit 6c8f6ba

Please sign in to comment.