void putfnbr(float number)
{
int a = (int) number;
putnbr(a);
write(1, ".", 1);
int i = 6;
while (i > 0)
{
number = (number - a) * (10);
a = (int) number;
putnbr(a);
i--;
}
}
putfnbr(123.456555);// output 123.456558
printf("\n%f", 123.456555); // output 123.456555
this function works well however the last number
it's converting to another number in this example:
5 becomes 8,
I want it to print the whole number as it's as the printf()
dose