Hi,
Bit of a newbie C++ programmer, and I was wondering if someone could help me.
I have an if statement as follows:
void ABalanceSmooth::getParameterDisplay(long index, char *text)
{
if (fBal==0)
{
strcpy (text, " Hard Left ");
}
else if (fBal==1.0)
{
strcpy (text, " Centre ");
}
else if (fBal==2.0)
{
strcpy (text, " Hard Right ");
}
else
float2string(fBal,text);
}
Where fBal==1.0 in order to display Centre, I would like it to display Centre between values from 0.98 to 1.02. I'm trying normal operators <, >, <= and >= and they don't seem to be working.
Any ideas?
Cheers.
Bit of a newbie C++ programmer, and I was wondering if someone could help me.
I have an if statement as follows:
void ABalanceSmooth::getParameterDisplay(long index, char *text)
{
if (fBal==0)
{
strcpy (text, " Hard Left ");
}
else if (fBal==1.0)
{
strcpy (text, " Centre ");
}
else if (fBal==2.0)
{
strcpy (text, " Hard Right ");
}
else
float2string(fBal,text);
}
Where fBal==1.0 in order to display Centre, I would like it to display Centre between values from 0.98 to 1.02. I'm trying normal operators <, >, <= and >= and they don't seem to be working.
Any ideas?
Cheers.