btclock_v3/lib/btclock/data_handler.hpp

32 lines
1.3 KiB
C++
Raw Permalink Normal View History

2023-11-28 00:30:36 +00:00
#include <array>
#include <string>
#include <cmath>
2023-11-28 01:05:04 +00:00
#include <cstdint>
#include <vector>
2023-11-28 01:05:04 +00:00
2023-11-28 00:30:36 +00:00
#include "utils.hpp"
2024-08-14 22:37:50 +00:00
const char CURRENCY_USD = '$';
const char CURRENCY_EUR = '[';
const char CURRENCY_GBP = ']';
const char CURRENCY_JPY = '^';
const char CURRENCY_AUD = '_';
2024-08-14 22:37:50 +00:00
const char CURRENCY_CAD = '`';
const std::string CURRENCY_CODE_USD = "USD";
const std::string CURRENCY_CODE_EUR = "EUR";
const std::string CURRENCY_CODE_GBP = "GBP";
const std::string CURRENCY_CODE_JPY = "JPY";
const std::string CURRENCY_CODE_AUD = "AUD";
const std::string CURRENCY_CODE_CAD = "CAD";
std::array<std::string, NUM_SCREENS> parsePriceData(std::uint32_t price, char currency, bool useSuffixFormat = false, bool mowMode = false, bool shareDot = false);
std::array<std::string, NUM_SCREENS> parseSatsPerCurrency(std::uint32_t price, char currencySymbol, bool withSatsSymbol);
2023-11-28 01:05:04 +00:00
std::array<std::string, NUM_SCREENS> parseBlockHeight(std::uint32_t blockHeight);
std::array<std::string, NUM_SCREENS> parseHalvingCountdown(std::uint32_t blockHeight, bool asBlocks);
std::array<std::string, NUM_SCREENS> parseMarketCap(std::uint32_t blockHeight, std::uint32_t price, char currencySymbol, bool bigChars);
std::array<std::string, NUM_SCREENS> parseBlockFees(std::uint16_t blockFees);
2024-08-14 22:37:50 +00:00
char getCurrencySymbol(char input);
std::string getCurrencyCode(char input);
char getCurrencyChar(const std::string& input);