Updated Converter

This commit is contained in:
Florian Kinder
2014-02-12 23:53:21 +01:00
parent 0c4323b28d
commit 99791dec20
2 changed files with 6 additions and 3 deletions

View File

@@ -30,7 +30,7 @@ while (my $line = <CFG>) {
$collect = 0;
for (my $i=0; $i<scalar(@itemType); $i++) {
$cfg .= sprintf("\t\t%s{\"%s\",%.3f}\n", ($i > 0 ? ',' : ''), $itemType[$i], $itemChance[$i]);
$cfg .= sprintf("\t\t%s{\"%s\",%.2f}\n", ($i > 0 ? ',' : ''), $itemType[$i], $itemChance[$i]);
}
$cfg .= "\t};\n";
@@ -41,6 +41,8 @@ while (my $line = <CFG>) {
}
close(CFG);
$cfg =~ s/(\d+\.\d+)[0]+\}\s*$/$1}/gm;
open(NEWCFG,'>', $configFile) or die $!;
print NEWCFG $cfg;
close(NEWCFG);