I have number 0.2289 and i want round down it to make 0.2200 Can i help pls ?
i tried printf(%.2f/n) but it rounds it up
I have number 0.2289 and i want round down it to make 0.2200 Can i help pls ?
i tried printf(%.2f/n) but it rounds it up
Usually you will not have an exact representation of the rounded number but you can try to:
double roundDown2(const double number)
{
return floor(number * 100) / 100;
}
int main(void)
{
printf("%.20f\n", roundDown2( 0.2289));
}