Instance Method
rounded(rule:increment:)
iOS 15.0+
iPadOS 15.0+
Mac Catalyst 15.0+
macOS 12.0+
tvOS 15.0+
watchOS 8.0+
Modifies the format style to use the specified rounding rule and increment.
func rounded(rule: FloatingPointFormatStyle<Value>.Currency.Configuration.RoundingRule = .toNearestOrEven, increment: Double? = nil) -> FloatingPointFormatStyle<Value>.Currency
Parameters
ruleThe rounding rule to apply to the format style.
incrementA multiple by which the formatter rounds the fractional part. The formatter produces a value that is an even multiple of this increment. If this parameter is
nil(the default), the formatter doesn’t apply an increment.
Return Value
A floating-point currency format style modified to use the specified rounding rule and increment.