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_DISPLAY:
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -153,7 +153,26 @@ void OLED::updateOLED(e_state state, const String& statusText, const String& sta
|
|||
drawLogo(LOGO_FAILURE);
|
||||
break;
|
||||
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);
|
||||
u8g2.sendBuffer();
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue