@@ -35,6 +35,7 @@ import Foundation
3535public protocol NumericTextFormat : ParseableFormatStyle where FormatInput: NumericTextValue , FormatOutput == String {
3636 associatedtype NumericTextScheme : NumericTextStyles . NumericTextScheme
3737 associatedtype SignDisplayStrategy : NumericTextSignDisplayStrategyRepresentable
38+ associatedtype RoundingIncrement
3839
3940 //=------------------------------------------------------------------------=
4041 // MARK: State
@@ -49,6 +50,7 @@ public protocol NumericTextFormat: ParseableFormatStyle where FormatInput: Numer
4950 @inlinable func sign( strategy: Self . SignDisplayStrategy ) -> Self
5051 @inlinable func precision( _ precision: NumberFormatStyleConfiguration . Precision ) -> Self
5152 @inlinable func decimalSeparator( strategy: NumberFormatStyleConfiguration . DecimalSeparatorDisplayStrategy ) -> Self
53+ @inlinable func rounded( rule: FloatingPointRoundingRule , increment: Self . RoundingIncrement ? ) -> Self
5254
5355 //=------------------------------------------------------------------------=
5456 // MARK: Translation
@@ -66,6 +68,7 @@ extension NumericTextFormat {
6668 @usableFromInline typealias Precision = NumberFormatStyleConfiguration . Precision
6769 @usableFromInline typealias Separator = NumberFormatStyleConfiguration . DecimalSeparatorDisplayStrategy
6870 @usableFromInline typealias Sign = NumericTextSignDisplayStrategy
71+ @usableFromInline typealias Rounded = FloatingPointRoundingRule
6972
7073 //=------------------------------------------------------------------------=
7174 // MARK: Parse
@@ -86,6 +89,10 @@ extension NumericTextFormat {
8689 @inlinable func separator( _ strategy: Self . Separator ) -> Self {
8790 self . decimalSeparator ( strategy: strategy)
8891 }
92+
93+ @inlinable func rounded( _ strategy: Self . Rounded ) -> Self {
94+ self . rounded ( rule: strategy, increment: nil )
95+ }
8996}
9097
9198//*============================================================================*
0 commit comments