mirror of
https://codeberg.org/scip/rpnc.git
synced 2025-12-17 12:31:04 +01:00
fixed converters
This commit is contained in:
17
rpnc
17
rpnc
@@ -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{}
|
||||
|
||||
Reference in New Issue
Block a user