$_srp_price = 123.456789; $cost = sprintf "\$%.2f", $_srp_price; $string = "Cost $cost\n"; print $string; __DATA__ Cost $123.46