all youve done there is created strings with teh values L1, L2 etc. you need to make a variable variable, like this (sometimes a bit hard to get your head around)...
$i = 1;
while($i<=5) {
$variable_name="L".$i;
$$variable_name=$i;
print "Cost: ";
print my_rounder($$variable_name);
print "<br>";
$i++;
}
I often use that same kinda principle, for instance, for getting variables from the POST array (if there are alot)
instead of saying...
$var1=$_POST['var1'];
$var2=$_POST['var2'];
...... etc
you can just creating a loop, with variable varaibles....
foreach($_POST as $key => $val){
$$key = $val;
}
Hope that helps, its a really hard thing to explain.