// Numbas version: exam_results_page_options {"name": "Show amounts of currency with trailing zeros", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Show amounts of currency with trailing zeros", "tags": [], "metadata": {"description": "

This question shows how to use the currency function to display amounts of currency with the correct symbols.

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "

Use the currency function to format amounts of money.

\n

Plain text: {currency(a,\"£\",\"p\")}

\n

In TeX: $\\var{currency(a,\"£\",\"p\")} + \\var{currency(b,\"£\",\"p\")} = \\var{currency(a+b,\"£\",\"p\")}$

\n

\n

For convenience, you can define a custom function which uses your preferred prefix and suffix.

\n

Plain text: {pounds(a)}

\n

In TeX: $\\var{pounds(a)} + \\var{pounds(b)} = \\var{pounds(a+b)}$

", "advice": "", "rulesets": {}, "extensions": [], "variables": {"a": {"name": "a", "group": "Ungrouped variables", "definition": "random(1..20#0.1)", "description": "", "templateType": "anything"}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "random(1..20#0.1)", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["a", "b"], "variable_groups": [], "functions": {"pounds": {"parameters": [["n", "number"]], "type": "string", "language": "jme", "definition": "currency(n,\"\u00a3\",\"p\")"}}, "preamble": {"js": "", "css": ""}, "parts": [], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}]}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}]}