Skip to content

Commit b59c72c

Browse files
committed
removed formatToEthereumUnits from Utilities
1 parent 3372dbd commit b59c72c

File tree

1 file changed

+0
-22
lines changed

1 file changed

+0
-22
lines changed

Sources/Core/Utility/Utilities.swift

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -112,20 +112,6 @@ public struct Utilities {
112112
return mainPart
113113
}
114114

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-
129115
/// Formats a BigInt object to String. The supplied number is first divided into integer and decimal part based on "toUnits",
130116
/// then limit the decimal part to "decimals" symbols and uses a "decimalSeparator" as a separator.
131117
/// Fallbacks to scientific format if higher precision is required.
@@ -142,14 +128,6 @@ public struct Utilities {
142128
}
143129
}
144130

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-
153131
/// Formats a BigUInt object to String. The supplied number is first divided into integer and decimal part based on "numberDecimals",
154132
/// then limits the decimal part to "formattingDecimals" symbols and uses a "decimalSeparator" as a separator.
155133
/// Fallbacks to scientific format if higher precision is required.

0 commit comments

Comments
 (0)