Q:

Printing a double without the decimal places

I have a number stored as a double and want to print it without the decimal places.  So if I had the double value 919545634521.000000, it is always printed with the decimal places added to it.  How can I print it without it so it looks like: 919545634521?
#include<stdlib.h>

int main()
{
    double number = 9220343120;
    printf("%??\n", number);
}

A:

try
printf("%.0lf\n",phoneNum);

you may also prefer
long long phoneNum;
phoneNum = strtoll(buffer,NULL,0);
printf("%lld\n",phoneNum);

instead. Depending on the system, though, you may need other function to convert (I think it's _strtoui64 for windows).

A:

Well, don't store the phone number as a floating-point number (one wrong move, and you'll end up with your telephone numbers getting rounded for you).
Store it as an integer or a string.

