Thank you so so much.
How could I have the fraction pat without "0." ? just the number.
thanks
this the code I used :
double w = 7.00123456789;
cout << "the main number is : "<<w<<'\n';
int week = w; // It will contain only 7
//You can get the fractional part:
cout << "the Int part is : " <<week<<'\n';
double tmp_d = w - week; // it will be 0.decimal part
cout << setprecision(11)<<"the Decimal part is : " <<tmp_d<<'\n';
the result is :
the main number is : 7.00123456789
the Int part is : 7
the Decimal part is : 0.00123456789
but I could not turn it to a string properly including all the 11 digits.
and could not use th ToString function at all, I don't know why.
I am using Microsoft Visual Studio 2010.
when I use multiply the number by 1.0e11 it change the number on 11 digits.
0.00123456789*1.0e11 = 123456789
but :
long int multiply = 0.12345678999* 1.0e11; = -2147483648
float multiply = 0.12345678999* 1.0e11; = 12345678848.00000000000
double multiply = 0.12345678999* 1.0e11; = 12345678998.99996600000
thanks it should be the best .
I tried to use this code but got an error ; Error: namespace "std" has no member "llrint" and "trunc" as well.
I've used the #include <cmath> and #include <math.h>
Thank you so so so so much for your help.
I used the multiply the number by 1.0e11 with "unsigned long long" argument and it worked.
thanks again, that was your kind of it.
but the last code you've sent was absolutely great.