Skip to content

Commit f582755

Browse files
committed
Merge branch 'main' of github.com:edgex-Tech/edgex-python-sdk into main
2 parents 1e7643b + 383d46f commit f582755

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

edgex_sdk/order/client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import math
12
import time
23
from decimal import Decimal
34
from typing import Dict, Any, Optional, List
@@ -92,8 +93,8 @@ async def create_order(self, params: CreateOrderParams, metadata: Dict[str, Any]
9293
except (ValueError, TypeError):
9394
raise ValueError("failed to parse fee rate")
9495

95-
# Calculate fee amount in decimal with 6 decimal places
96-
amount_fee_dm = (value_dm * fee_rate).quantize(Decimal("0.000001"))
96+
# Calculate fee amount in decimal with ceiling to integer
97+
amount_fee_dm = Decimal(str(math.ceil(float(value_dm * fee_rate))))
9798
amount_fee_str = str(amount_fee_dm)
9899

99100
# Convert to the required integer format for the protocol

0 commit comments

Comments
 (0)