Rounding Floats

Hi, I was wondering if anybody knows an easy way to round floats. I wrote a program calculating money, and I'd like to display the right amount of decimal places for dollars and cents. Right now, it's printing numbers like "156.945957" and I'd just like it to print "156.95". Thanks in advance.

you can use printf and specify how much to round up by with %.Nf where N represents how far you want to round off.
i.e. %.2f will round off to 2 decimal places. %.3f will go to 3 decimal places and so on.

there are only 10 people in the world, those who know binary and those who dont