Return Type | Function name | Arguments |
---|---|---|
void | SpeakNumber | (hzChain&,int,) |
Declared in file: hzTextproc.h
Defined in file : hzTextproc.cpp
Function Logic:
Function body:
void SpeakNumber (hzChain& Z, int nValue) { _hzfunc("SpeakNumber") ; hzString v ; int32_t B ; int32_t M ; int32_t T ; int32_t U ; 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) ; }