// Numbas version: exam_results_page_options {"name": "Show amounts of currency with trailing zeros", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"showfrontpage": false, "allowregen": true, "preventleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"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)}\$

", "rulesets": {}, "functions": {"pounds": {"type": "string", "language": "jme", "definition": "currency(n,\"\u00a3\",\"p\")", "parameters": [["n", "number"]]}}, "preamble": {"css": "", "js": ""}, "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

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

"}, "tags": [], "type": "question", "variablesTest": {"maxRuns": 100, "condition": ""}, "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}], "variable_groups": [], "advice": "", "variables": {"b": {"name": "b", "templateType": "anything", "definition": "random(1..20#0.1)", "description": "", "group": "Ungrouped variables"}, "a": {"name": "a", "templateType": "anything", "definition": "random(1..20#0.1)", "description": "", "group": "Ungrouped variables"}}, "ungrouped_variables": ["a", "b"], "parts": [], "extensions": [], "name": "Show amounts of currency with trailing zeros"}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}]}