- , 100 ( 2 ), , "" . , :
#include <iostream>
#include <iomanip>
#include <math.h>
using namespace std;
int main(int argc, char** argv)
{
const double numberToDisplay = 0.999;
double origInteger;
double origDecimal;
modf(numberToDisplay, &origInteger);
double decimal = numberToDisplay - origInteger;
cout << decimal << endl;
modf(decimal * 100, &origDecimal);
double final = origInteger + (origDecimal / 100);
cout << final << endl;
return 0;
}
: casting to (int) , .