// 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}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"rulesets": {}, "variable_groups": [], "ungrouped_variables": ["a", "b"], "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)}\$

", "variablesTest": {"maxRuns": 100, "condition": ""}, "tags": [], "parts": [], "advice": "", "metadata": {"description": "

This question is out of date: use the currency function instead.

", "licence": "Creative Commons Attribution 4.0 International"}, "preamble": {"js": "", "css": ""}, "name": "Show amounts of currency with trailing zeros", "variables": {"a": {"name": "a", "description": "", "group": "Ungrouped variables", "definition": "random(1..20#0.1)", "templateType": "anything"}, "b": {"name": "b", "description": "", "group": "Ungrouped variables", "definition": "random(1..20#0.1)", "templateType": "anything"}}, "type": "question", "extensions": [], "functions": {"pounds": {"parameters": [["n", "number"]], "language": "jme", "definition": "currency(n,\"\u00a3\",\"p\")", "type": "string"}}, "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/"}]}