Floating point values are weird and strange. You should keep sums internally as integral value with small enough unit (say penny). Integer math -- division and modulus -- work a treat. When you absolutely have to print a decimal number, do the conversion only for the print.
Oh, yes. That thingy. constint internalprice = static_cast<int>( 100 * price + 0.5 );
The rationale is that the cast discards fraction, and if your "3" for some reason is 2.99999, adding 0.5 gives about 3.49999, which converts to 3.
The rounding functions in cmath return double; you still have to cast, if you store as integer.