假设我们有一个NSDecimal
常量total
,它包含 3.33333333 除以 10/3 的值。10和3都是NSDecimalNumber
。NSDecimalNumber
在 Swift 中,我们希望总数为 4 。
let total = ten/three
// the ideal total would be rounded up whenever there is a floating
在文档中。我们有
func NSDecimalRound(_ result: UnsafeMutablePointer<NSDecimal>,
_ number: UnsafePointer<NSDecimal>,
_ scale: Int,
_ roundingMode: NSRoundingMode)
maximumDecimalNumber()
哪一个最适合货币风格的计算器?如果你知道的话,请包括一个如何使用它们的例子。谢谢你 。