An extension of the Number to Text functionality which supports numbers with units of measures. More...
#include <NumberUnitToText.h>
Classes | |
struct | DecimalInfo |
Units might have different decimals. The decimal system is based on 3. But currencies have usually 2. More... | |
Public Member Functions | |
NumberUnitToText (const char *defaultUnit) | |
audio_tools::Vector< const char * > & | say (double value, const char *unit=nullptr, int decimals=2) |
converts a real number with a unit to it's text representation | |
audio_tools::Vector< const char * > & | say (int64_t wholeNumber, const char *unit=nullptr) |
converts an integer with a unit to it's text representation | |
audio_tools::Vector< const char * > & | say (const char *wholeNumber, const char *decimals, const char *unitIn) |
converts a number provided by string components to it's text representation | |
virtual audio_tools::Vector< const char * > & | allTexts () |
Provides all texts. | |
![]() | |
virtual audio_tools::Vector< const char * > & | allTexts ()=0 |
virtual void | registerCallback (void(*ptr)(audio_tools::Vector< const char * > words, void *refx), void *ref) |
void | printCSV (Print &out) |
Protected Attributes | |
const char * | default_unit = nullptr |
audio_tools::Vector< const char * > | result |
NumberToText | ntt |
const char * | unit_1 [max_unit_1][3] |
const char * | unit2 [max_unit_2][4] |
const char * | unit3 [max_unit_3][2] |
const DecimalInfo | decimal_info [decimal_info_len] = {{"usd", 2}} |
![]() | |
void(* | callback )(audio_tools::Vector< const char * > word, void *ref) = nullptr |
void * | reference = nullptr |
An extension of the Number to Text functionality which supports numbers with units of measures.
|
inlinevirtual |
Provides all texts.
Implements simple_tts::SimpleTTSBase.
|
protected |
|
protected |
|
protected |