model_server/obj/src/int_to_string.cxx
// This subroutine converts a number in the range -99 to 99 to
// its text equivalent
// the word "negative" is not prefixed
This subroutine converts a number in the range -99 to 99 to
its text equivalent
the word "negative" is not prefixed
This subroutine converts a number in the range - 99 to 99 to its text equivalent the word " negative " is not prefixed
void tens_to_string( VAL_TYPE number, ostream& os)
{
    Initialize(tens_to_string);
    IF(number < -99 || number > 99) Error(ERR_INPUT);
    number = abs(number);
    if(number < 10)      os << ones[number];
    else if(number < 20) os << teens[number - 10];
    else
    {
        os << tens[number/10];
        VAL_TYPE dd = number % 10;
        if(dd) os << ' ' << ones[dd];
    }
    Return
}
void tens_to_string ( VAL_TYPE number , ostream & os ) { Initialize ( tens_to_string ) ; IF ( number < -99 || number > 99 ) Error ( ERR_INPUT ) ; number = abs ( number ) ; if ( number < 10 ) os << ones [ number ] ; else if ( number < 20 ) os << teens [ number - 10 ] ; else { os << tens [ number / 10 ] ; VAL_TYPE dd = number % 10 ; if ( dd ) os << ' ' << ones [ dd ] ; } Return }
This subroutine converts a number in the range -99 to 99 to
its text equivalent
the word "negative" is not prefixed
This subroutine converts a number in the range - 99 to 99 to its text equivalent the word " negative " is not prefixed
// to maintain proper indexing we need to use the absolute value