fix:基础信息
This commit is contained in:
@@ -18,7 +18,7 @@ func CentitoDollar(price int64, remainFloatPoint ...uint) float64 {
|
||||
}
|
||||
|
||||
// 厘转美元
|
||||
func CentitoDollarStr(price int64) string {
|
||||
func CentitoDollarStr(price float64) string {
|
||||
s := "%.2f"
|
||||
return fmt.Sprintf(s, float64(price)/float64(1000))
|
||||
return fmt.Sprintf(s, price/float64(1000))
|
||||
}
|
||||
|
||||
@@ -91,9 +91,9 @@ type GetAmountCurrencyUSDReq struct {
|
||||
// 处理金额(元)
|
||||
func GetAmountCurrencyFormat(req *gmodel.AmountCurrency) (res gmodel.AmountCurrency) {
|
||||
return gmodel.AmountCurrency{
|
||||
ExchangeRate: format.CentitoDollarStr(req.ExchangeRate.(int64)),
|
||||
CurrentAmount: format.CentitoDollarStr(req.CurrentAmount.(int64)),
|
||||
OriginalAmount: format.CentitoDollarStr(req.OriginalAmount.(int64)),
|
||||
ExchangeRate: format.CentitoDollarStr(req.ExchangeRate.(float64)),
|
||||
CurrentAmount: format.CentitoDollarStr(req.CurrentAmount.(float64)),
|
||||
OriginalAmount: format.CentitoDollarStr(req.OriginalAmount.(float64)),
|
||||
CurrentCurrency: req.CurrentCurrency,
|
||||
OriginalCurrency: req.OriginalCurrency,
|
||||
}
|
||||
@@ -101,6 +101,8 @@ func GetAmountCurrencyFormat(req *gmodel.AmountCurrency) (res gmodel.AmountCurre
|
||||
|
||||
// 处理金额(元)
|
||||
func GetAmountInfoFormat(req *gmodel.AmountInfo) gmodel.AmountInfo {
|
||||
Current := GetAmountCurrencyFormat(&req.Current)
|
||||
fmt.Println(Current)
|
||||
return gmodel.AmountInfo{
|
||||
Change: GetAmountCurrencyFormat(&req.Change),
|
||||
ChangeRemark: req.ChangeRemark,
|
||||
|
||||
Reference in New Issue
Block a user