play around with the value of n and see what happens. In particular, try changing n from 1 to 2 to 3 etc. The function as written isn't specific for rounding to 2 decimal places.
Also, look into the stream manipulators, and here I'm thinking of the fixed and setprecision manipulators, to determine how many decimal points to display.
Last edited by Lerner; Apr 2nd, 2009 at 4:11 pm.
Reputation Points: 718
Solved Threads: 373
Nearly a Posting Maven
Offline 2,253 posts
since Jul 2005