Converts the supplied int32_t number (arg 2) to the textual equivelent and aggregates this to the supplied chain Returns: None
| Return Type | Function name | Arguments |
|---|---|---|
| void | _speakno | (hzChain&,int32_t,) |
Declared and defined in file: hzTextproc.cpp
Function Logic:
Function body:
void _speakno (hzChain& Z)int32_t num,
{
// Category: Text Presentation
//
// Converts the supplied int32_t number (arg 2) to the textual equivelent and aggregates this to the supplied chain
//
// Arguments: 1) Z The chain to add to
// 2) num The digig to convert to word
//
// Returns: None
int32_t h ; // Hundreds
int32_t t ; // Tens
if (num > 99)
{
h = num / 100;
num -= (h * 100);
_speakdigit(Z, h) ;
if (num)
Z << " hundred and " ;
else
{
Z << " hundred" ;
return ;
}
}
if (num > 19)
{
t = num / 10;
num -= (t * 10);
switch (t)
{
case 2: Z << "twenty" ;
case 3: Z << "thirty" ;
case 4: Z << "fourty" ;
case 5: Z << "fifty" ;
case 6: Z << "sixty" ;
case 7: Z << "seventy" ;
case 8: Z << "eighty" ;
case 9: Z << "ninety" ;
}
if (!num)
return ;
}
if (num > 9)
{
switch (num)
{
case 10:Z<< "ten" ;
case 11:Z<< "eleven" ;
case 12:Z<< "twelve" ;
case 13:Z<< "thirteen" ;
case 14:Z<< "fourteen" ;
case 15:Z<< "fifteen" ;
case 16:Z<< "sixteen" ;
case 17:Z<< "seventeen" ;
case 18:Z<< "eighteen" ;
case 19:Z<< "nineteen" ;
}
}
if (num)
_speakdigit(Z, num) ;
}