代码拉取完成,页面将自动刷新
package amountdecimal
import "errors"
// @title: initialization uint8 type
// @auth: jishulang.com
// @date: 2022/7/30 20:59
func NewUint8(amount uint8) *AmountDecimal {
return NewUint64(uint64(amount))
}
// @title: addition uint8 type
// @auth: jishulang.com
// @date: 2022/7/30 20:59
func (c *AmountDecimal) AddUint8(amounts ...uint8) *AmountDecimal {
return c.amountsUint8(add, amounts...)
}
// @title: subtraction uint8 type
// @auth: jishulang.com
// @date: 2022/7/30 20:59
func (c *AmountDecimal) SubUint8(amounts ...uint8) *AmountDecimal {
return c.amountsUint8(sub, amounts...)
}
// @title: multiplication uint8 type
// @auth: jishulang.com
// @date: 2022/7/30 20:59
func (c *AmountDecimal) MulUint8(amounts ...uint8) *AmountDecimal {
return c.amountsUint8(mul, amounts...)
}
// @title: division uint8 type
// @auth: jishulang.com
// @date: 2022/7/30 20:59
func (c *AmountDecimal) DivUint8(amounts ...uint8) *AmountDecimal {
return c.amountsUint8(div, amounts...)
}
func (c *AmountDecimal) amountsUint8(f uint8, amounts ...uint8) *AmountDecimal {
if c.err != nil {
return c
}
if len(amounts) == 0 {
c.err = errors.New(errCodeMap[amounts_empty])
return c
}
var amounts2 []uint64
for _, amount := range amounts {
amounts2 = append(amounts2, uint64(amount))
}
return c.amountsUint64(f, amounts2...)
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。