|
@@ -792,10 +792,9 @@ class GoodsTradeActivity : BaseActivity<GoodsTradeViewModel>() {
|
|
|
//行情变化后根据不同的价格类型分别对赋值
|
|
//行情变化后根据不同的价格类型分别对赋值
|
|
|
viewModel.quoteDayData.bindOptional(context) {
|
|
viewModel.quoteDayData.bindOptional(context) {
|
|
|
if (viewModel.priceOrderType.value == FutureConstent.eOrderPriceSelectType_Last) {//最新价
|
|
if (viewModel.priceOrderType.value == FutureConstent.eOrderPriceSelectType_Last) {//最新价
|
|
|
- setText(it?.last.toString())
|
|
|
|
|
-
|
|
|
|
|
|
|
+ setText(NumberUtils.roundNum(NumberUtils.doubleDistortion(it?.last.toString()),2))
|
|
|
} else if (viewModel.priceOrderType.value == FutureConstent.eOrderPriceSelectType_Opposite) {//对手价/买多取卖一价
|
|
} else if (viewModel.priceOrderType.value == FutureConstent.eOrderPriceSelectType_Opposite) {//对手价/买多取卖一价
|
|
|
- setText(it?.ask.toString())
|
|
|
|
|
|
|
+ setText(NumberUtils.roundNum(NumberUtils.doubleDistortion(it?.ask.toString()),2))
|
|
|
} else if (viewModel.priceOrderType.value == FutureConstent.eOrderPriceSelectType_OppositeOne) {//超价1/买多取卖一价(参照ios)
|
|
} else if (viewModel.priceOrderType.value == FutureConstent.eOrderPriceSelectType_OppositeOne) {//超价1/买多取卖一价(参照ios)
|
|
|
setText(setExceedPrice(it?.ask ?:0.0,0))
|
|
setText(setExceedPrice(it?.ask ?:0.0,0))
|
|
|
} else if (viewModel.priceOrderType.value == FutureConstent.eOrderPriceSelectType_BidPrice) {//指定价就是限价--限价只需要在选择限价时赋值,其他行情推送不赋值
|
|
} else if (viewModel.priceOrderType.value == FutureConstent.eOrderPriceSelectType_BidPrice) {//指定价就是限价--限价只需要在选择限价时赋值,其他行情推送不赋值
|
|
@@ -806,14 +805,14 @@ class GoodsTradeActivity : BaseActivity<GoodsTradeViewModel>() {
|
|
|
viewModel.priceOrderType.bindOptional(context) {
|
|
viewModel.priceOrderType.bindOptional(context) {
|
|
|
val quoteData = viewModel.quoteDayData.value
|
|
val quoteData = viewModel.quoteDayData.value
|
|
|
if (it == FutureConstent.eOrderPriceSelectType_Last) {//最新价
|
|
if (it == FutureConstent.eOrderPriceSelectType_Last) {//最新价
|
|
|
- setText(quoteData?.last.toString())
|
|
|
|
|
|
|
+ setText(NumberUtils.roundNum(NumberUtils.doubleDistortion(quoteData?.last.toString()),2))
|
|
|
} else if (it == FutureConstent.eOrderPriceSelectType_Opposite) {//对手价/买多取卖一价
|
|
} else if (it == FutureConstent.eOrderPriceSelectType_Opposite) {//对手价/买多取卖一价
|
|
|
- setText(quoteData?.ask.toString())
|
|
|
|
|
|
|
+ setText(NumberUtils.roundNum(NumberUtils.doubleDistortion(quoteData?.ask.toString()),2))
|
|
|
} else if (it == FutureConstent.eOrderPriceSelectType_OppositeOne) {//超价/买多取卖一价(参照ios)
|
|
} else if (it == FutureConstent.eOrderPriceSelectType_OppositeOne) {//超价/买多取卖一价(参照ios)
|
|
|
// setText(quoteData?.ask.toString())
|
|
// setText(quoteData?.ask.toString())
|
|
|
setText(setExceedPrice(quoteData?.ask ?:0.0,0))
|
|
setText(setExceedPrice(quoteData?.ask ?:0.0,0))
|
|
|
} else if (it == FutureConstent.eOrderPriceSelectType_BidPrice) {//指定价就是限价
|
|
} else if (it == FutureConstent.eOrderPriceSelectType_BidPrice) {//指定价就是限价
|
|
|
- setText(quoteData?.last.toString())
|
|
|
|
|
|
|
+ setText(NumberUtils.roundNum(NumberUtils.doubleDistortion(quoteData?.last.toString()),2))
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
textSizeAuto = 38
|
|
textSizeAuto = 38
|
|
@@ -873,9 +872,9 @@ class GoodsTradeActivity : BaseActivity<GoodsTradeViewModel>() {
|
|
|
//行情变化后根据不同的价格类型分别对赋值
|
|
//行情变化后根据不同的价格类型分别对赋值
|
|
|
viewModel.quoteDayData.bindOptional(context) {
|
|
viewModel.quoteDayData.bindOptional(context) {
|
|
|
if (viewModel.priceOrderType.value == FutureConstent.eOrderPriceSelectType_Last) {//最新价
|
|
if (viewModel.priceOrderType.value == FutureConstent.eOrderPriceSelectType_Last) {//最新价
|
|
|
- setText(it?.last.toString())
|
|
|
|
|
|
|
+ setText(NumberUtils.roundNum(NumberUtils.doubleDistortion(it?.last.toString()),2))
|
|
|
} else if (viewModel.priceOrderType.value == FutureConstent.eOrderPriceSelectType_Opposite) {//对手价/卖多取买一价
|
|
} else if (viewModel.priceOrderType.value == FutureConstent.eOrderPriceSelectType_Opposite) {//对手价/卖多取买一价
|
|
|
- setText(it?.ask.toString())
|
|
|
|
|
|
|
+ setText(NumberUtils.roundNum(NumberUtils.doubleDistortion(it?.ask.toString()),2))
|
|
|
} else if (viewModel.priceOrderType.value == FutureConstent.eOrderPriceSelectType_OppositeOne) {//超价1/卖多取买一价(参照ios)
|
|
} else if (viewModel.priceOrderType.value == FutureConstent.eOrderPriceSelectType_OppositeOne) {//超价1/卖多取买一价(参照ios)
|
|
|
setText(setExceedPrice(it?.bid ?: 0.0,1))
|
|
setText(setExceedPrice(it?.bid ?: 0.0,1))
|
|
|
} else if (viewModel.priceOrderType.value == FutureConstent.eOrderPriceSelectType_BidPrice) {//指定价就是限价--限价只需要在选择限价时赋值,其他行情推送不赋值
|
|
} else if (viewModel.priceOrderType.value == FutureConstent.eOrderPriceSelectType_BidPrice) {//指定价就是限价--限价只需要在选择限价时赋值,其他行情推送不赋值
|
|
@@ -886,14 +885,14 @@ class GoodsTradeActivity : BaseActivity<GoodsTradeViewModel>() {
|
|
|
viewModel.priceOrderType.bindOptional(context) {
|
|
viewModel.priceOrderType.bindOptional(context) {
|
|
|
val quoteData = viewModel.quoteDayData.value
|
|
val quoteData = viewModel.quoteDayData.value
|
|
|
if (it == FutureConstent.eOrderPriceSelectType_Last) {//最新价
|
|
if (it == FutureConstent.eOrderPriceSelectType_Last) {//最新价
|
|
|
- setText(quoteData?.last.toString())
|
|
|
|
|
|
|
+ setText(NumberUtils.roundNum(NumberUtils.doubleDistortion(quoteData?.last.toString()),2))
|
|
|
} else if (it == FutureConstent.eOrderPriceSelectType_Opposite) {//对手价/卖多取买一价
|
|
} else if (it == FutureConstent.eOrderPriceSelectType_Opposite) {//对手价/卖多取买一价
|
|
|
- setText(quoteData?.bid.toString())
|
|
|
|
|
|
|
+ setText(NumberUtils.roundNum(NumberUtils.doubleDistortion(quoteData?.bid.toString()),2))
|
|
|
} else if (it == FutureConstent.eOrderPriceSelectType_OppositeOne) {//超价/卖多取买一价(参照ios)
|
|
} else if (it == FutureConstent.eOrderPriceSelectType_OppositeOne) {//超价/卖多取买一价(参照ios)
|
|
|
setText(setExceedPrice(quoteData?.bid ?:0.0,1))
|
|
setText(setExceedPrice(quoteData?.bid ?:0.0,1))
|
|
|
|
|
|
|
|
} else if (it == FutureConstent.eOrderPriceSelectType_BidPrice) {//指定价就是限价
|
|
} else if (it == FutureConstent.eOrderPriceSelectType_BidPrice) {//指定价就是限价
|
|
|
- setText(quoteData?.last.toString())
|
|
|
|
|
|
|
+ setText(NumberUtils.roundNum(NumberUtils.doubleDistortion(quoteData?.last.toString()),2))
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
textSizeAuto = 38
|
|
textSizeAuto = 38
|
|
@@ -952,12 +951,12 @@ class GoodsTradeActivity : BaseActivity<GoodsTradeViewModel>() {
|
|
|
text = "优先平今"
|
|
text = "优先平今"
|
|
|
} else {
|
|
} else {
|
|
|
if (viewModel.priceOrderType.value == FutureConstent.eOrderPriceSelectType_Last) {//最新价
|
|
if (viewModel.priceOrderType.value == FutureConstent.eOrderPriceSelectType_Last) {//最新价
|
|
|
- setText(it?.last.toString())
|
|
|
|
|
|
|
+ setText(NumberUtils.roundNum(NumberUtils.doubleDistortion(it?.last.toString()),2))
|
|
|
|
|
|
|
|
} else if (viewModel.priceOrderType.value == FutureConstent.eOrderPriceSelectType_Opposite) {//对手价/卖多取买一价
|
|
} else if (viewModel.priceOrderType.value == FutureConstent.eOrderPriceSelectType_Opposite) {//对手价/卖多取买一价
|
|
|
- setText(it?.ask.toString())
|
|
|
|
|
|
|
+ setText(NumberUtils.roundNum(NumberUtils.doubleDistortion(it?.ask.toString()),2))
|
|
|
} else if (viewModel.priceOrderType.value == FutureConstent.eOrderPriceSelectType_OppositeOne) {//超价1/卖多取买一价(参照ios)
|
|
} else if (viewModel.priceOrderType.value == FutureConstent.eOrderPriceSelectType_OppositeOne) {//超价1/卖多取买一价(参照ios)
|
|
|
- setText(it?.ask.toString())
|
|
|
|
|
|
|
+ setText(NumberUtils.roundNum(NumberUtils.doubleDistortion(it?.ask.toString()),2))
|
|
|
} else if (viewModel.priceOrderType.value == FutureConstent.eOrderPriceSelectType_BidPrice) {//指定价就是限价--限价只需要在选择限价时赋值,其他行情推送不赋值
|
|
} else if (viewModel.priceOrderType.value == FutureConstent.eOrderPriceSelectType_BidPrice) {//指定价就是限价--限价只需要在选择限价时赋值,其他行情推送不赋值
|
|
|
// setText(it?.last.toString())
|
|
// setText(it?.last.toString())
|
|
|
}
|
|
}
|
|
@@ -971,13 +970,13 @@ class GoodsTradeActivity : BaseActivity<GoodsTradeViewModel>() {
|
|
|
} else {
|
|
} else {
|
|
|
val quoteData = viewModel.quoteDayData.value
|
|
val quoteData = viewModel.quoteDayData.value
|
|
|
if (it == FutureConstent.eOrderPriceSelectType_Last) {//最新价
|
|
if (it == FutureConstent.eOrderPriceSelectType_Last) {//最新价
|
|
|
- setText(quoteData?.last.toString())
|
|
|
|
|
|
|
+ setText(NumberUtils.roundNum(NumberUtils.doubleDistortion(quoteData?.last.toString()),2))
|
|
|
} else if (it == FutureConstent.eOrderPriceSelectType_Opposite) {//对手价/卖多取买一价
|
|
} else if (it == FutureConstent.eOrderPriceSelectType_Opposite) {//对手价/卖多取买一价
|
|
|
- setText(quoteData?.bid.toString())
|
|
|
|
|
|
|
+ setText(NumberUtils.roundNum(NumberUtils.doubleDistortion(quoteData?.bid.toString()),2))
|
|
|
} else if (it == FutureConstent.eOrderPriceSelectType_OppositeOne) {//超价/卖多取买一价(参照ios)
|
|
} else if (it == FutureConstent.eOrderPriceSelectType_OppositeOne) {//超价/卖多取买一价(参照ios)
|
|
|
- setText(quoteData?.bid.toString())
|
|
|
|
|
|
|
+ setText(NumberUtils.roundNum(NumberUtils.doubleDistortion(quoteData?.bid.toString()),2))
|
|
|
} else if (it == FutureConstent.eOrderPriceSelectType_BidPrice) {//指定价就是限价
|
|
} else if (it == FutureConstent.eOrderPriceSelectType_BidPrice) {//指定价就是限价
|
|
|
- setText(quoteData?.last.toString())
|
|
|
|
|
|
|
+ setText(NumberUtils.roundNum(NumberUtils.doubleDistortion(quoteData?.last.toString()),2))
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|