feat: Updates styles
This commit is contained in:
14
Sources/ViewController/Extensions/String+double.swift
Normal file
14
Sources/ViewController/Extensions/String+double.swift
Normal file
@@ -0,0 +1,14 @@
|
||||
import Foundation
|
||||
|
||||
private let numberFormatter: NumberFormatter = {
|
||||
let formatter = NumberFormatter()
|
||||
formatter.numberStyle = .decimal
|
||||
formatter.maximumFractionDigits = 2
|
||||
return formatter
|
||||
}()
|
||||
|
||||
extension String.StringInterpolation {
|
||||
mutating func appendInterpolation(double: Double) {
|
||||
appendInterpolation(numberFormatter.string(from: NSNumber(value: double))!)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user