Display fake yen balance properly
This commit is contained in:
parent
70c3499e02
commit
faa7d29451
|
@ -350,7 +350,10 @@ void loop() {
|
||||||
case STATE_RESULT_FAILURE:
|
case STATE_RESULT_FAILURE:
|
||||||
case STATE_RESULT_DISPLAY:
|
case STATE_RESULT_DISPLAY:
|
||||||
if (!cooldownCheck(gTimeout)) {
|
if (!cooldownCheck(gTimeout)) {
|
||||||
oled.updateOLED(state, lastStatusText, String(cooldownSecondsRemaining(gTimeout, timer)));
|
if (PN532Reader::mode == PN532_MIFARE_ISO14443A)
|
||||||
|
oled.updateOLED(state, lastStatusText, String(cooldownSecondsRemaining(gTimeout, timer)));
|
||||||
|
else
|
||||||
|
oled.updateOLED(state, lastStatusText, String(cooldownSecondsRemaining(gTimeout, timer)), true);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -153,7 +153,26 @@ void OLED::updateOLED(e_state state, const String& statusText, const String& sta
|
||||||
drawLogo(LOGO_FAILURE);
|
drawLogo(LOGO_FAILURE);
|
||||||
break;
|
break;
|
||||||
case STATE_RESULT_DISPLAY:
|
case STATE_RESULT_DISPLAY:
|
||||||
drawFullScreenText(splitString(statusText, ':', 0), splitString(statusText, ':', 1) + "€");
|
if (japan) {
|
||||||
|
String balance = splitString(statusText, ':', 1);
|
||||||
|
balance.replace(",", "");
|
||||||
|
if (balance.startsWith("-")) {
|
||||||
|
balance.replace("-00", "-");
|
||||||
|
balance.replace("-0", "-");
|
||||||
|
balance.replace("-", "-¥");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (balance.startsWith("00"))
|
||||||
|
balance = balance.substring(2);
|
||||||
|
else if (balance.startsWith("0"))
|
||||||
|
balance = balance.substring(1);
|
||||||
|
balance = "¥" + balance;
|
||||||
|
}
|
||||||
|
drawFullScreenText(splitString(statusText, ':', 0), balance);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
drawFullScreenText(splitString(statusText, ':', 0), splitString(statusText, ':', 1) + "€");
|
||||||
|
|
||||||
drawStatusText(splitString(statusText, ':', 2), statusTextRightAligned);
|
drawStatusText(splitString(statusText, ':', 2), statusTextRightAligned);
|
||||||
u8g2.sendBuffer();
|
u8g2.sendBuffer();
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue