release 1.11.2
[descalc.git] / 35_unitconv.pm
index 1374ccf529baa91ceb3cfc9e2dc92cc39dce3100..3cf2540540eac540915155a51507410954170f89 100644 (file)
@@ -1,11 +1,13 @@
 # unit convertor for DCT, by Shiar
 
-# 1.09.1 200410022305 - moved %unit specs from 1.9 main
-# 1.09.2 200410112205 - all code moved here as well
+# 1.11.0 200410291000 - use redraw()
+# 1.10.5 200410151900 - data storage units (8 total, including LOC)
+# 1.10.4 200410132300 - hp49 units for mass
+# 1.10.3 200410130000 - fix error when run without menu module
+# 1.10.2 200410122200 - adds submenus with all units
 # 1.10.1 200410122030 - hp49 units for area, volume, time, speed, force, energy, power
-#     .2         2200 - adds submenus with all units
-#     .3     10130000 - fix error when run without menu module
-#     .4     10132300 - hp49 units for mass
+# 1.09.2 200410112205 - all code moved here as well
+# 1.09.1 200410022305 - moved %unit specs from 1.9 main
 
 use strict;
 use warnings;
@@ -177,6 +179,18 @@ do {
 #      [], # light
 #      [], # radiation
 #      [], # viscosity
+
+       [
+               "data storage", # memory
+               ['B', 1, "byte"],
+               ['kB', 1024, "kilobyte"],
+               ['MB', 1024**2, "megabyte"],
+               ['GB', 1024**3, "gigabyte"],
+               ['TB', 1024**4, "terabyte"],
+               ['bit', 1/8, "bit/octet"],
+               ['Mbit', 1024**2/8, "megabit"],
+               ['LOC', 19e12, 'Library of Congress'], # est. 17-20TB
+       ],
 ); # units table
 
 push @{$hook{precmd}}, sub {
@@ -187,7 +201,7 @@ push @{$hook{precmd}}, sub {
 #                      $stack[0] -= $_->{diff} if $_->{diff};
 #                      $stack[0] += $val{unit}{diff}*$val{unit}{val}/$_->{val} if $val{unit}{diff};
                        $stack[0] *= delete($val{unit})->{val} / $_->{val};
-                       showstack();
+                       redraw(1);
                        undef %val;
                } # convert
                else {
@@ -204,6 +218,6 @@ push @{$hook{postentry}}, sub {
 return {
        author  => "Shiar",
        title   => "unit convertor",
-       version => "1.10.4",
+       version => "1.11",
 };