If you'd like the leading dollar sign:
$subtotal = sprintf( "$.2f", $subtotal );
Otherwise:
$subtotal = sprintf( ".2f", $subtotal );
Just keep in mind that usually, if a monetary amount is a fraction of a penny, you need to
add 1 penny. This isn't much of an issue with subtotals, in my experience, since you're dealing with a whole quantity of whole items. But, if you're dealing with tax, or anything else that may return a fraction of a penny, be careful.
-Rich