Hi, all,
I am helping a group in Kenya write WeBWorK problems for middle school students. Here is the issue:
There is a difference in how large numbers are stated in Kenya and the U.S. In Kenya, a large number will be written as: 2 345 011 with spaces instead of commas. The issue is especially bothersome in problems with currency. I can change the currency symbol to "sh" (shillings) but WeBWorK puts in the commas automatically. I think a custom macro would be nice, so they could load the macro and have it all set. I've included code for a problem below. It would also be nice to have something for plain large numbers that would be course wide--not sure how that would work.
Thanks--rac
------------Start code-------------------------------------------
DOCUMENT();
loadMacros(
"PGstandard.pl",
"PGML.pl",
"contextCurrency.pl"
);
####################
# Set-up
Context("Currency");
Context()->currency->set(symbol=>'sh');
Context()->currency->setSymbol(sh=>{associativity=>"left"});
Context()->flags->set(trimTrailingZeros=>1);
#Context()->currency->set(comma=>' ',decimal=>'.');
$a = random(300,800);
$a = Compute("sh $a");
$b = random(1000,10000);
$b = Compute("sh $b");
$sum = $a+$b;
##################################
# Main text
BEGIN_PGML
Add: [`[$a] + [$b] = `] [____]{$sum}{12}
END_PGML
ENDDOCUMENT();
---------------------------------------------------------------------