diff --git a/unstoppable-ios-app/domains-manager-ios/Entities/Debugger.swift b/unstoppable-ios-app/domains-manager-ios/Entities/Debugger.swift index 2ba99b6af..1f8f4c222 100644 --- a/unstoppable-ios-app/domains-manager-ios/Entities/Debugger.swift +++ b/unstoppable-ios-app/domains-manager-ios/Entities/Debugger.swift @@ -61,7 +61,7 @@ public struct Debugger { case .debugUI: return [.Error, .Navigation, .UI, .Images, .Debug] case .debugNetwork: - return [.Network, .WebSockets, .Error, .Debug] + return [.Network, .WebSockets, .Error, .Debug, .mpc] case .custom(let topics): return topics } diff --git a/unstoppable-ios-app/domains-manager-ios/Extensions/Double.swift b/unstoppable-ios-app/domains-manager-ios/Extensions/Double.swift index f48b2738f..80cb75ca7 100644 --- a/unstoppable-ios-app/domains-manager-ios/Extensions/Double.swift +++ b/unstoppable-ios-app/domains-manager-ios/Extensions/Double.swift @@ -33,26 +33,13 @@ extension Double { extension Numeric where Self: LosslessStringConvertible { func formatted(toMaxNumberAfterComa maxNumberAfterComa: Int, minNumberAfterComa: Int = 2) -> String { + let numberFormatter = NumberFormatter() + numberFormatter.numberStyle = .decimal + numberFormatter.maximumFractionDigits = maxNumberAfterComa + numberFormatter.minimumFractionDigits = minNumberAfterComa + numberFormatter.decimalSeparator = "." + numberFormatter.groupingSeparator = "" - let str = String(self) - let maxNativelySupportedDecimalsAfterCome = 14 - if maxNumberAfterComa > maxNativelySupportedDecimalsAfterCome, - let indexOfDecimal = str.firstIndex(of: ".") { - let fractionalPart = str[str.index(after: indexOfDecimal)...] - if fractionalPart.count > maxNativelySupportedDecimalsAfterCome { - let integerPart = str[..