[system] / trunk / pg / macros / parserNumberWithUnits.pl Repository:
ViewVC logotype

Annotation of /trunk/pg/macros/parserNumberWithUnits.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4997 - (view) (download) (as text)

1 : dpvc 2731 loadMacros('Parser.pl');
2 :    
3 :     sub _parserNumberWithUnits_init {}; # don't reload this file
4 :    
5 : gage 4997 =head1 DESCRIPTION
6 :    
7 : dpvc 2731 ######################################################################
8 :     #
9 :     # This is a Parser class that implements a number with units.
10 :     # It is a temporary version until the Parser can handle it
11 :     # directly.
12 :     #
13 :     # Use NumberWithUnits("num units") or NumberWithUnits(formula,"units")
14 :     # to generate a NumberWithUnits object, and then call its cmp method
15 :     # to get an answer checker for your number with units.
16 :     #
17 :     # Usage examples:
18 :     #
19 :     # ANS(NumberWithUnits("3 ft")->cmp);
20 :     # ANS(NumberWithUnits("$a*$b ft")->cmp);
21 :     # ANS(NumberWithUnits($a*$b,"ft")->cmp);
22 :     #
23 :    
24 :     #
25 : dpvc 4666 # We now call on the Legacy version, which is used by
26 :     # num_cmp to handle numbers with units.
27 : dpvc 2731 #
28 : gage 4997
29 :     =cut
30 :    
31 : dpvc 4666 sub NumberWithUnits {Parser::Legacy::NumberWithUnits->new(@_)}
32 : dpvc 2731
33 :     1;

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9