This commit is contained in:
furrtek 2017-11-02 17:11:26 +00:00
parent 6e7b2c751f
commit 2ec24c9fa8
11 changed files with 136 additions and 99 deletions

View file

@ -35,6 +35,8 @@ enum TimeFormat {
HM = 2
};
const char unit_prefix[7] { 'n', 'u', 'm', 0, 'k', 'M', 'G' };
// TODO: Allow l=0 to not fill/justify? Already using this way in ui_spectrum.hpp...
std::string to_string_bin(const uint32_t n, const uint8_t l = 0);
std::string to_string_dec_uint(const uint32_t n, const int32_t l = 0, const char fill = 0);
@ -47,4 +49,6 @@ std::string to_string_short_freq(const uint64_t f);
std::string to_string_datetime(const rtc::RTC& value, const TimeFormat format = YMDHMS);
std::string to_string_timestamp(const rtc::RTC& value);
std::string unit_auto_scale(double n, const uint32_t base_nano, uint32_t precision);
#endif/*__STRING_FORMAT_H__*/