(Answer) (Category) LON-CAPA User Help : (Category) Authoring : (Category) Authoring Problems :
How do I display dollar signs in my problem?
if you did $dollar='$'; this will work however this is a bad
idea. Have them do this:

Script:
$a=&random(1,10,.01);

Text:
You have $${a} monies.

If they want to use $ in the answer they will need to do a string
answer type. They will also need to do this:

Script:
$a=&random(1,10,.01);
$answer='$'.$a;

Text:
You have $${a} or $answer monies.

Response:
<stringresponse answer="$answer">
You can also use:

<display>&prettyprint($var,'$2f')</display>
[Append to This Answer]
Previous: (Answer) How do I create a problem?
Next: (Answer) How do I code an absolute value?
This document is: http://help.loncapa.org/cgi-bin/fom?file=87
[Search] [Appearance] [Show This Answer As Text]
This is a Faq-O-Matic 2.719.
This FAQ administered by the LON-CAPA team at MSU. Submit a help request ticket to contact us.