Round percentage

This commit is contained in:
Sik Yoon 2024-04-06 20:08:52 +09:00
parent f6dd5730ea
commit 712922fc3e

View File

@ -962,7 +962,7 @@ pub async fn monitoring_filled_sell_order(
for element in filled_sell_orders {
// build insert value
let pure_profit_usdt = decimal_sub(element.get_usdt_fee_adjusted, element.used_usdt);
let pure_profit_percent = decimal_mul(decimal_div(pure_profit_usdt, element.used_usdt), dec!(100));
let pure_profit_percent = decimal_mul(decimal_div(pure_profit_usdt, element.used_usdt), dec!(100)).round_dp(2);
insert_value_build.clear();
insert_value_build.push(element.symbol.clone()); // symbol
insert_value_build.push(server_epoch.to_string()); // soldtime