in reply to Help with decimals

You say that some of your numbers will already have decimals in them. If you have a number like 1500 that you want to display as 15.00, then what do you want to do with numbers like 1501.5 or 1501.55? Do you want them to print as 15.02 and 15.02 (correctly rounded)? Or do you want them to print as 1501.50 and 1501.55?

If the former, then the printf( "%.2f", $foo/100 ) solution works fine (although I don't know if it will round correctly for display or not)... If the latter, then you really need to ask why you are storing your numbers in such a disparate fashion and consider standardizing. Otherwise you have to convert units (i.e. do math) at some point, utterly dependent on the units of the original number.