Converts the supplied int32_t number (arg 2) to the textual equivelent and aggregates this to the supplied chain Returns: None

Return TypeFunction nameArguments
voidSpeakNumber(hzChain&,int32_t,)

Declared in file: hzTextproc.h
Defined in file : hzTextproc.cpp

Function Logic:

0:START 1:unknown 2:items - nValue nValue 3:B nValue ( M nValue ( T nValue U 4:unknown 5:B 6:nValue items 7:unknown 8:items 9:items 10: No text 11:unknown 12:M 13:nValue items 14:unknown 15:items 16:items 17: No text 18:unknown 19:T 20:nValue items 21:unknown 22:items 23:items 24: No text 25:unknown 26:items 27: No text

Function body:

void SpeakNumber (hzChain& Z)int32_t nValue, 
{
   //  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  Output chain aggregated by this operation
   //     2) nValue The numeric value
   //  
   //  Returns: None
   _hzfunc("SpeakNumber") ;
   hzString    v ;     //  To be returned
   int32_t     B ;     //  Billions
   int32_t     M ;     //  Millions
   int32_t     T ;     //  Thousands
   int32_t     U ;     //  Units (0-999)
   if (nValue < 0)
   {
       Z << "Minus " ;
       nValue *= -1;
   }
   B = (nValue / 1000000000);
   M = (nValue % 1000000000)/1000000;
   T = (nValue % 1000000)/1000;
   U = (nValue % 1000);
   if (B)
   {
       nValue -= (B * 1000000000);
       _speakno(Z, B) ;
       if (nValue)
           Z << " billion, " ;
       else
       {
           Z << " billion" ;
           return ;
       }
   }
   if (M)
   {
       nValue -= (M * 1000000);
       _speakno(Z, M) ;
       if (nValue)
           Z << " million, " ;
       else
       {
           Z << " million" ;
           return ;
       }
   }
   if (T)
   {
       nValue -= (T * 1000000);
       _speakno(Z, T) ;
       if (nValue)
           Z << " thousand and " ;
       else
       {
           Z << " thousand" ;
           return ;
       }
   }
   if (U)
       _speakno(Z, U) ;
}