From: Damyan Ivanov Date: Thu, 20 Feb 2020 17:34:01 +0000 (+0200) Subject: add currency symbol to debug output X-Git-Tag: v0.12.0~87 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=93896a91bb9f92a9921f180844871727c60f99fe;p=mobile-ledger.git add currency symbol to debug output --- diff --git a/app/src/main/java/net/ktnx/mobileledger/model/Data.java b/app/src/main/java/net/ktnx/mobileledger/model/Data.java index 9b832b03..0a2efe9f 100644 --- a/app/src/main/java/net/ktnx/mobileledger/model/Data.java +++ b/app/src/main/java/net/ktnx/mobileledger/model/Data.java @@ -165,12 +165,12 @@ public final class Data { public static void refreshCurrencyData(Locale locale) { NumberFormat formatter = NumberFormat.getCurrencyInstance(locale); java.util.Currency currency = formatter.getCurrency(); - Logger.debug("locale", - String.format("Discovering currency symbol position for locale %s (currency is %s)", - locale.toString(), currency.toString())); + String symbol = currency.getSymbol(); + Logger.debug("locale", String.format( + "Discovering currency symbol position for locale %s (currency is %s; symbol is %s)", + locale.toString(), currency.toString(), symbol)); String formatted = formatter.format(1234.56f); Logger.debug("locale", String.format("1234.56 formats as '%s'", formatted)); - String symbol = currency.getSymbol(); if (formatted.startsWith(symbol)) currencySymbolPosition.setValue(Currency.Position.before); else if (formatted.endsWith(symbol))