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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

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

Legend:
Removed from v.5372  
changed lines
  Added in v.5373

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9