Updated on 2026-08-14
This commit is contained in:
parent
e6fcb9e2fe
commit
40c37826bf
198 changed files with 791 additions and 704 deletions
|
|
@ -6,9 +6,11 @@ import java.text.DecimalFormat
|
|||
import java.text.DecimalFormatSymbols
|
||||
import java.util.*
|
||||
|
||||
//todo determine where to place this extensions
|
||||
// todo determine where to place this extensions
|
||||
fun BigDecimal.toFormattedString(
|
||||
decimals: Int, roundingMode: RoundingMode = RoundingMode.DOWN, locale: Locale = Locale.US,
|
||||
decimals: Int,
|
||||
roundingMode: RoundingMode = RoundingMode.DOWN,
|
||||
locale: Locale = Locale.US,
|
||||
): String {
|
||||
val symbols = DecimalFormatSymbols(locale)
|
||||
val df = DecimalFormat().apply {
|
||||
|
|
@ -36,7 +38,7 @@ fun BigDecimal.toFormattedFiatValue(
|
|||
): String {
|
||||
val fiatValue = this.setScale(2, RoundingMode.HALF_UP)
|
||||
.let { if (formatWithSpaces) it.formatWithSpaces() else it }
|
||||
return " ${fiatValue} $fiatCurrencyName"
|
||||
return " $fiatValue $fiatCurrencyName"
|
||||
}
|
||||
|
||||
@Suppress("MagicNumber")
|
||||
|
|
|
|||
|
|
@ -16,9 +16,10 @@ object FeatureCoroutineExceptionHandler {
|
|||
val sw = StringWriter()
|
||||
throwable.printStackTrace(PrintWriter(sw))
|
||||
val exceptionAsString: String = sw.toString()
|
||||
//it delegates logging to android Logger, cause cant use timber in java module
|
||||
// it delegates logging to android Logger, cause cant use timber in java module
|
||||
Logger.getLogger("CoroutineExceptHandler").log(
|
||||
Level.INFO, "CoroutineException: from: $from, exception: $exceptionAsString",
|
||||
Level.INFO,
|
||||
"CoroutineException: from: $from, exception: $exceptionAsString",
|
||||
)
|
||||
throw throwable
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,4 +25,4 @@ package com.tangem.utils.detekt
|
|||
AnnotationTarget.TYPEALIAS
|
||||
)
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
annotation class UnusedRequiredComponent(val description: String)
|
||||
annotation class UnusedRequiredComponent(val description: String)
|
||||
Loading…
Add table
Add a link
Reference in a new issue