my $name = ...; ## from user input my $amount = ...; printf "$name : \$%.02f\n", $amount; # instead of # printf "%s : \$%.02f\n", $name, $amount;