mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-12-04 14:06:38 +01:00
changes
This commit is contained in:
1 parent
72904266bf
commit
c738f5ee29
19 files changed
+1125
-499
No files matched your search
@@ -9,5 +9,8 @@ def truncate_decimal(value, decimal_places):
|
||||
:param decimal_places: The number of decimal places to keep
|
||||
:return: Truncated Decimal value
|
||||
"""
|
||||
if isinstance(value, (int, float)):
|
||||
value = Decimal(str(value))
|
||||
|
||||
multiplier = Decimal(10**decimal_places)
|
||||
return (value * multiplier).to_integral_value(rounding=ROUND_DOWN) / multiplier
|
||||
Reference in new issue
Block a user