@@ -112,20 +112,6 @@ public struct Utilities {
112
112
return mainPart
113
113
}
114
114
115
- /// Formats a BigInt object to String. The supplied number is first divided into integer and decimal part based on "toUnits",
116
- /// then limit the decimal part to "decimals" symbols and uses a "decimalSeparator" as a separator.
117
- ///
118
- /// Returns nil of formatting is not possible to satisfy.
119
- static func formatToEthereumUnits( _ bigNumber: BigInt , toUnits: Utilities . Units = . eth, decimals: Int = 4 , decimalSeparator: String = " . " ) -> String ? {
120
- guard let formatted = formatToPrecision ( bigNumber, numberDecimals: toUnits. decimals, formattingDecimals: decimals, decimalSeparator: decimalSeparator, fallbackToScientific: false ) else { return nil }
121
- switch bigNumber. sign {
122
- case . plus:
123
- return formatted
124
- case . minus:
125
- return " - " + formatted
126
- }
127
- }
128
-
129
115
/// Formats a BigInt object to String. The supplied number is first divided into integer and decimal part based on "toUnits",
130
116
/// then limit the decimal part to "decimals" symbols and uses a "decimalSeparator" as a separator.
131
117
/// Fallbacks to scientific format if higher precision is required.
@@ -142,14 +128,6 @@ public struct Utilities {
142
128
}
143
129
}
144
130
145
- // /// Formats a BigUInt object to String. The supplied number is first divided into integer and decimal part based on "toUnits",
146
- // /// then limit the decimal part to "decimals" symbols and uses a "decimalSeparator" as a separator.
147
- // ///
148
- // /// Returns nil of formatting is not possible to satisfy.
149
- // static func formatToEthereumUnits(_ bigNumber: BigUInt, toUnits: Utilities.Units = .eth, decimals: Int = 4, decimalSeparator: String = ".", fallbackToScientific: Bool = false) -> String? {
150
- // return formatToPrecision(bigNumber, numberDecimals: toUnits.decimals, formattingDecimals: decimals, decimalSeparator: decimalSeparator, fallbackToScientific: fallbackToScientific)
151
- // }
152
-
153
131
/// Formats a BigUInt object to String. The supplied number is first divided into integer and decimal part based on "numberDecimals",
154
132
/// then limits the decimal part to "formattingDecimals" symbols and uses a "decimalSeparator" as a separator.
155
133
/// Fallbacks to scientific format if higher precision is required.
0 commit comments