i'm using C++ and i don't know how to change a decimal number to integer. for example, 7.345 WEEKS (week is the unit)..i want to change the decimal, 0.345 WEEKS to DAYS which is an integer. let say the answer will be 7 WEEKS 2 DAYS rather than 7.345 WEEKS. what coding should i write to change it? Thanks
decimal is the number system we use: it has ten digits. Both 3 and 49.2 are decimal numbers.
A whole number (and for simplicity here, integer numbers) are our counting numbers: 1, 2, 3, 4, 5, etc.
A real number is one that may contain fractional values. In computers, real numbers are often represented with the floating-point number type. Your number, 7.345, is a floating-point number.