diff --git a/app/models/open_spot_order.rb b/app/models/open_spot_order.rb index d083125..0da7bee 100644 --- a/app/models/open_spot_order.rb +++ b/app/models/open_spot_order.rb @@ -4,6 +4,6 @@ def current_price end def margin_rate - current_price.zero? ? 0 : ((price - current_price) / current_price) * 100 + current_price.zero? ? 0 : ((current_price - price) / current_price) * 100 end end diff --git a/app/views/page/open_spot_orders.html.erb b/app/views/page/open_spot_orders.html.erb index 0f37da1..b68984f 100644 --- a/app/views/page/open_spot_orders.html.erb +++ b/app/views/page/open_spot_orders.html.erb @@ -22,9 +22,8 @@ 买卖类别 委托价 当前价 - 委托家和当前价的比例 + 委托价和当前价的比例 委托数量 - 成交数量 委托金额 订单类型 @@ -38,9 +37,8 @@ <%= I18n.t("views.trading.#{order.trade_type}") %> <%= order.price.round(4) %> <%= order.current_price.round(4) %> - <%= order.margin_rate.round(2) %>% + <%= order.margin_rate.round(2) %>% <%= order.orig_qty.round(4) %> - <%= order.executed_qty.round(4) %> <%= order.amount.round(4) %> <%= order.order_type %>