my $temp='%.'.abs($ad).'f'; $temp=~/^(.*)$/; $temp=$1; my $value = sprintf($temp,$f);