Skip to content

Commit cbae951

Browse files
committed
NumericTextStyles: merged Value+Decimals.swift and Value+Floats.swift.
1 parent f555429 commit cbae951

File tree

2 files changed

+14
-29
lines changed

2 files changed

+14
-29
lines changed

Sources/DiffableTextStylesXNumeric/Value+Decimals.swift

Lines changed: 0 additions & 25 deletions
This file was deleted.

Sources/DiffableTextStylesXNumeric/Value+Floats.swift

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,27 @@
1010
import Foundation
1111

1212
//*============================================================================*
13-
// MARK: * Float x Protocol
13+
// MARK: * Decimal
1414
//*============================================================================*
1515

16-
private protocol _Float: BinaryFloatingPoint, Values.Signed, Values.FloatingPoint,
17-
Values.Numberable, Values.Currencyable, Values.Percentable where FormatStyle == FloatingPointFormatStyle<Self> { }
16+
extension Decimal: Values.Signed, Values.FloatingPoint,
17+
Values.Numberable, Values.Currencyable, Values.Percentable {
18+
19+
//=------------------------------------------------------------------------=
20+
// MARK: Precision, Bounds
21+
//=------------------------------------------------------------------------=
22+
23+
public static let precision: Count = precision(38)
24+
public static let bounds: ClosedRange<Self> = bounds(Self(string: String(repeating: "9", count: 38))!)
25+
}
1826

1927
//*============================================================================*
2028
// MARK: * Double
2129
//*============================================================================*
2230

23-
extension Double: _Float {
31+
extension Double: Values.Signed, Values.FloatingPoint,
32+
Values.Numberable, Values.Currencyable, Values.Percentable {
33+
public typealias FormatStyle = FloatingPointFormatStyle<Self>
2434

2535
//=------------------------------------------------------------------------=
2636
// MARK: Precision, Bounds

0 commit comments

Comments
 (0)