I am updating problems that I wrote last year. I have a problem template that has an array in it which worked last year, i.e. the dollar signs showed up in the array:
------------Code that worked last year-------------------------
\[ \begin{array}{c|c|c}
& \mbox{Marginal} & \cr
\mbox{Fixed Cost} & \mbox{Cost per item} & \mbox{Item Sells For} \cr
\hline
$DOLLAR$fix & $DOLLAR$m & $DOLLAR$price \cr
\end{array} \]
--------------------------------------------------------------------
The values are displayed with a "36;" in place of the dollar sign, 36;2175, where $fix = 2175. If I make the values Currency objects then the values show up as: 2,175.00 with commas and the period but no dollar sign. This much shows up in \[ $f \] but nothing shows up if I use \( $f \) where $f = Currency($fix).
I can probably do this in a table, but I didn't want the lines of a table to show up. This code worked last year. How do I make it work now?
Another question: I am using the $DOLLAR command because I want the money to show up in the form, $ddd and not $ddd.cc. Is there a way in Currency format to not have the cents show if there are no cents ? i.e. show $25 and not $25.00, but if the value is $5.40 then require the student to enter the correct currency format?
Another note: Then a Currency object is the correct answer and a hardcopy with "Correct answers" is made, the values show up as "\$2,459", which is the TeX format, but it would be nicer if it showed up without the backslash.
The pertinent code is pasted below if that helps.
Thanks -- rac
-------------------------------------------------------
DOCUMENT(); # This should be the first executable line in the problem.
loadMacros(
"PGstandard.pl",
"MathObjects.pl",
"contextCurrency.pl" #This is used later in the answer section
);
TEXT(&beginproblem);
######################################
# Setup
$fix = random(15000,20000,1000);
$m = random(12,30,1);
$price = $m + random(5,50,5);
######################################
# Main text
BEGIN_TEXT
Assume each function is linear and use the information given below to
find:
$BR
\[ \begin{array}{c|c|c}
& \mbox{Marginal} & \cr
\mbox{Fixed Cost} & \mbox{Cost per item} & \mbox{Item Sells For} \cr
\hline
$DOLLAR$fix & $DOLLAR$m & $DOLLAR$price \cr
\end{array} \]
END_TEXT
ENDDOCUMENT();