1. ## big numbers

how do i display a floating point number without the decimals.

I.E., how do i make this:

//code:
printf("%f", number);

//output:
1.00000

look like this:

//code
printf("%f", number);

//output
1

2. display it as a int not a float.

3. no no.... you dont understand...... maybe i should make it more clear:

how do i turn this:

//code
printf("%f", number);
//output
99999999999999999999999999999.00000

into this:

//code
printf("%f", number);
//output
99999999999999999999999999999

4. printf("/i",number) ;

5. doesnt even work at all....

prints /i

or if you meant \i, it gives an 'unknown escape sequance' error.

6. Code:
```float number = 1234.56;

printf( "%f", (int)number );```
casting to int will truncate the fractional part.

7. that doesnt work either.

now it just prints the number as ' 0.00000 ' no matter what.

8. printf("%0.0f", f);

;-)

9. Sorry, I meant this:

printf( "%d", (int)number );

10. Well, you could just use:

printf("%.0f",f);

The .0 means 0 digits printed after the decimal point. .1 would mean 1 digit etc.

11. ahh...

beautiful!

12. ## my mistake

I really should stop visiting this board once I can't remeber the last time I slept(I think it was last tuesday :-)).

13. For God's sake:

printf("%d",number);

14. ## Totally useless question

Why is it %d for integers, instead of %i or something?????

PS: I'm ALWAYS fooled that % =96

15. >Why is it %d for integers, instead of %i or something?????
Both are allowed, but there are differences in how they behave and should be used.

For printf, %d and %i are both flags for signed decimal notation. For scanf, %d is a decimal integer pointer and %i is an integer pointer which may be of a base other than decimal.

%i isn't used often because it's better to be explicit in how you are representing the base with %o, %x, and %d.

Btw,
Code:
```#include <stdio.h>

int main ( void )
{
long double d = 12345678987634534.0;
printf ( "%.0lf\n", d );
return 0;
}```
Fiddle with this a bit, you'll find that you can remove the decimal and anything that follows with a %.0 flag, and a long double will give you a precision up to 17 digits.

>printf( "%d", (int)number );
Have you tried this? It works okay as long as the number is small enough to fit in an integer, otherwise you get incorrect output.

>printf("%d",number);
No, and test something before you offer it as a solution.

-Prelude