model_server/obj/src/int_to_string.cxx
// This subroutine converts a number in the range of -999 to 999
// to its text equivalent.
// the word "negative" is not prefixed.
This subroutine converts a number in the range of -999 to 999
to its text equivalent.
the word "negative" is not prefixed.
This subroutine converts a number in the range of - 999 to 999 to its text equivalent . the word " negative " is not prefixed .
void hundreds_to_string(VAL_TYPE number, ostream& os)
{
    Initialize(hundreds_to_string);
    IF(number < -999 || number > 999) Error(ERR_INPUT);
    VAL_TYPE hundreds = number / 100;
    VAL_TYPE rem =      number % 100;
    if(hundreds)
    {
        tens_to_string(hundreds, os);
        os << " hundred ";
    }
    if (rem)
      tens_to_string(rem, os);
}
void hundreds_to_string ( VAL_TYPE number , ostream & os ) { Initialize ( hundreds_to_string ) ; IF ( number < -999 || number > 999 ) Error ( ERR_INPUT ) ; VAL_TYPE hundreds = number / 100 ; VAL_TYPE rem = number % 100 ; if ( hundreds ) { tens_to_string ( hundreds , os ) ; os << " " ; } if ( rem ) tens_to_string ( rem , os ) ; }
This subroutine converts a number in the range of -999 to 999
to its text equivalent.
This subroutine converts a number in the range of - 999 to 999 to its text equivalent .
// range check // the number of 100s in the number // the left over digits // if number > 100 create a string for it // create a string for digits unaccounted for by hundreds