1234567891011121314151617181920
#include <iostream> using namespace std; double placevalue (double a) { double b = a * 100; int c = b; double d = c / 100; return (d); } int main () { double x = 345.2359745; double y; y = placevalue (x); cout << "#:" << y; cin.get(); return 0; }
#:345
double d = c / 100.0;
123
double truncate_to_two_decimal_places(double val) { return floor(val * 100.0) / 100.0; }