fixed converters

This commit is contained in:
Thomas von Dein
2020-03-29 20:36:02 +02:00
parent 93ca7421ed
commit e270d6de7a

17
rpnc
View File

@@ -3,6 +3,7 @@
use Term::ReadLine;
use Data::Dumper;
use Getopt::Long;
use Data::Dumper;
use strict;
use warnings;
@@ -174,18 +175,18 @@ my %func = (
},
# converters:
# gallons to liters
'tl' => sub { return $_[0] * 3.785 },
'tl' => sub { return $_[-1] * 3.785 },
# yards to meters
'tm' => sub { return $_[0] * 91.44 },
'tm' => sub { return $_[-1] * 91.44 },
# miles to kilometers
'tk' => sub { return $_[0] * 1.609 },
'tk' => sub { return $_[-1] * 1.609 },
# inches to cm
'tc' => sub { return $_[0] * 2.54 },
'tc' => sub { return $_[-1] * 2.54 },
# to 'bytes
'tkb' => sub { return $_[0] / 1000 },
'tmb' => sub { return $_[0] / 1000 / 1000},
'tgb' => sub { return $_[0] / 1000 / 1000 / 1000 },
'ttb' => sub { return $_[0] / 1000 / 1000 / 1000 / 1000 },
'tkb' => sub { return $_[-1] / 1000 },
'tmb' => sub { return $_[-1] / 1000 / 1000},
'tgb' => sub { return $_[-1] / 1000 / 1000 / 1000 },
'ttb' => sub { return $_[-1] / 1000 / 1000 / 1000 / 1000 },
);
# math constants, always upper case letters, usable via eval{}