I am a beginner in C++ and for an assignment I wrote code for a number to English conversion. My problem is getting the decimal from an integer. Upon advice I changed the void expand to a double value and changed the code for getting the decimal, and now I receive an "invalid operands of types double and int to binary operator %" for the remainder of my code. Something to do with (value)?
void expand(double);
int main()
{
......
}
void expand(double value)
{
string const ones[20] =
{
" ...... "
}
if(value>1)
{
double decimalPart = value - (int)value;
}
else if(value>=1000)
{
expand(value/1000);
cout<<" thousand";
if(value % 1000)
.....