Add N/A if price is null

This commit is contained in:
Manfred Karrer 2016-05-22 02:38:14 +02:00
parent 6908bbc283
commit 0827db65ea

View file

@ -196,24 +196,23 @@ public class BSFormatter {
return fiatFormat.noCode().format(fiat).toString(); return fiatFormat.noCode().format(fiat).toString();
} catch (Throwable t) { } catch (Throwable t) {
log.warn("Exception at formatFiat: " + t.toString()); log.warn("Exception at formatFiat: " + t.toString());
return ""; return "N/A " + fiat.getCurrencyCode();
} }
} else { } else {
return ""; return "N/A";
} }
} }
public String formatFiatWithCode(Fiat fiat) { public String formatFiatWithCode(Fiat fiat) {
if (fiat != null) { if (fiat != null) {
try { try {
//return fiatFormat.postfixCode().format(fiat).toString();
return fiatFormat.noCode().format(fiat).toString() + " " + fiat.getCurrencyCode(); return fiatFormat.noCode().format(fiat).toString() + " " + fiat.getCurrencyCode();
} catch (Throwable t) { } catch (Throwable t) {
log.warn("Exception at formatFiatWithCode: " + t.toString()); log.warn("Exception at formatFiatWithCode: " + t.toString());
return ""; return "N/A " + fiat.getCurrencyCode();
} }
} else { } else {
return ""; return "N/A";
} }
} }