+our $ff = '%6.1f';
+
+sub valid ($) {
+ my ($x) = @_;
+ defined $x and $x and $x<1e5;
+}
+
+sub prvff ($$\@$) {
+ my ($what, $format, $ary, $unit) = @_;
+ printf("%-25s", "$what:");
+ for my $i (qw(0 1 2 3)) {
+ my $x= $ary->[$i];
+ my $y= valid($x) ? sprintf $format, $x : ' ';
+ printf " %-9s", $y;
+ }
+ printf " %s\n", $unit;
+}
+
+sub pr ($\@$) {
+ my ($what, $ary, $unit) = @_;
+ prvff($what, '%4d ', @$ary, $unit);
+}
+
+sub prf ($\@$) {
+ my ($what, $ary, $unit) = @_;
+ prvff($what, $ff, @$ary, $unit);
+}
+
+sub pr1 ($$) {
+ my ($k,$v) = @_;
+ printf "%-20s %s\n", "$k:", $v;
+}
+sub fmt_stock_index ($) {
+ my ($si) = @_;
+ @have==1 ? '' : ' #'.$si;
+}
+
+sub rum_total (\@) {
+ my ($rums) = @_;
+ my $total= 0;
+ foreach my $i (qw(0 1 2)) {
+ $total += $rums->[$i] * $proofs[$i] / 100;
+ }
+ return $total;
+}