| | |
| | | package com.xcong.excoin.modules.contract.parameter.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.xcong.excoin.utils.CommonUtils; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | |
| | | public String getOpeningPrice() { |
| | | |
| | | return dotFormat(openingPrice); |
| | | return CommonUtils.amountDotFormat(this.symbol, openingPrice); |
| | | } |
| | | |
| | | private String dotFormat(BigDecimal price) { |
| | | String priceFormat = ""; |
| | | switch (this.symbol) { |
| | | case "BTC/USDT": |
| | | case "ETH/USDT": |
| | | case "LTC/USDT": |
| | | case "BCH/USDT": |
| | | priceFormat = price.setScale(2, BigDecimal.ROUND_DOWN).toPlainString(); |
| | | break; |
| | | case "EOS/USDT": |
| | | case "XRP/USDT": |
| | | case "ETC/USDT": |
| | | priceFormat = price.setScale(4, BigDecimal.ROUND_DOWN).toPlainString(); |
| | | break; |
| | | default: |
| | | priceFormat = price.setScale(2, BigDecimal.ROUND_DOWN).toPlainString(); |
| | | } |
| | | return priceFormat; |
| | | public String getStopLossPrice() { |
| | | return CommonUtils.amountDotFormat(this.symbol, stopLossPrice); |
| | | } |
| | | |
| | | public String getStopProfitPrice() { |
| | | return CommonUtils.amountDotFormat(this.symbol, stopProfitPrice); |
| | | } |
| | | |
| | | public String getBondAmount() { |
| | | return dotFormat(bondAmount); |
| | | return bondAmount == null ? "" : bondAmount.setScale(2, BigDecimal.ROUND_DOWN).toPlainString(); |
| | | } |
| | | |
| | | public String getForceClosingPrice() { |
| | | return dotFormat(forceClosingPrice); |
| | | return CommonUtils.amountDotFormat(this.symbol, forceClosingPrice); |
| | | } |
| | | |
| | | public String getProfitOrLoss() { |