mirror of
https://github.com/btclock/btclock_v3.git
synced 2024-11-19 06:40:02 +01:00
24 lines
713 B
C++
24 lines
713 B
C++
#include "nostrdisplay_handler.hpp"
|
|
|
|
std::array<std::string, NUM_SCREENS> parseZapNotify(std::uint16_t amount, bool withSatsSymbol)
|
|
{
|
|
std::string text = std::to_string(amount);
|
|
std::size_t textLength = text.length();
|
|
std::size_t startIndex = NUM_SCREENS - textLength;
|
|
|
|
std::array<std::string, NUM_SCREENS> textEpdContent = {"ZAP", "mdi-lnbolt", "", "", "", "", ""};
|
|
|
|
// Insert the sats symbol just before the digits
|
|
if (startIndex > 0 && withSatsSymbol)
|
|
{
|
|
textEpdContent[startIndex - 1] = "STS";
|
|
}
|
|
|
|
// Place the digits
|
|
for (std::size_t i = 0; i < textLength; i++)
|
|
{
|
|
textEpdContent[startIndex + i] = text.substr(i, 1);
|
|
}
|
|
|
|
return textEpdContent;
|
|
} |