File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
Sources/TimecodeKit/Utilities/Outsourced Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ /// ----------------------------------------------
2
+ /// ----------------------------------------------
3
+ /// OTCore/Extensions/Swift/FloatingPoint.swift
4
+ ///
5
+ /// Borrowed from OTCore 1.4.14 under MIT license.
6
+ /// https://github.com/orchetect/OTCore
7
+ /// Methods herein are unit tested at their source
8
+ /// so no unit tests are necessary.
9
+ /// ----------------------------------------------
10
+ /// ----------------------------------------------
11
+
12
+ #if canImport(Foundation)
13
+
14
+ import Foundation
15
+
16
+ // MARK: - Digit Places
17
+
18
+ extension Double {
19
+ /// **OTCore:**
20
+ /// Returns the number of digit places of the ``integral`` portion (left of the decimal).
21
+ var integralDigitPlaces : Int {
22
+ Decimal ( self ) . integralDigitPlaces
23
+ }
24
+
25
+ /// **OTCore:**
26
+ /// Returns the number of digit places of the ``fraction`` portion (right of the decimal).
27
+ var fractionDigitPlaces : Int {
28
+ Decimal ( self ) . fractionDigitPlaces
29
+ }
30
+ }
31
+
32
+ #endif
You can’t perform that action at this time.
0 commit comments