All pastes #713949 Raw Edit

Something

public text v1 · immutable
#713949 ·published 2007-09-25 20:18 UTC
rendered paste body
$t=0;
$grp=3;
$mod=6;
while(<>){
 ~ s/^\s+//;
 ~ s/\s+$//;
 ~ s/F,.*$//;
 my ($i,$f) = split("\\.");
 $ints[$t]=$i;
 $fracs[$t]=$f;
 $t++;
}
$ilen = (sort {$b <=> $a} map {length} @ints )[0];
$flen = (sort {$b <=> $a} map {length} @fracs)[0];

printf "$ilen . $flen\n\n";

for($t=0;$t<=$#fracs;$t++){
    if(!($t%$grp)) {
        printf "{";
    }
    printf "%${ilen}d.%-${flen}d",$ints[$t],$fracs[$t];
    if($t!=0 && !(($t+1)%$grp)) {
        printf "}";
    }
    if(!(($t+1)%$mod)) {
        printf ",\n";
    }else {
        printf ", ";
    }
}