Large numbers and commas

Is there a way to allow for commas in number greater than 999? It feels weird to me to tell a student to enter an answer like 30,000 just as 30000. Particularly for pre-service elementary school teachers where the commas are very useful for determining place value, saying the word name, etc.

I know that this is a language difference where other parts of the world use commas instead of a decimal point. Is that the reasoning, or is there something else underlying the language and what a comma means?

We still have a lot of work to get ready to support other languages and conventions, so that isn’t the current limitation.

Then current limitation is that our math engine parses 30,0 and 30,000 as the list of two number 3 and 0. This convention allows people to require students to “separate multiple answers by commas.”

We could imagine an attribute on <mathInput> that says something like parseCommaAsThousandsSeparator (ignoring issues about localizing to other conventions). Getting such an attribute to do what we want, though, would take a lot of work, as we’d have to work with the internals of the math engine. And, we have to decide how it should handle misplaced commas like “30,00”.

Instead, we have a easy shortcut that might give you want you want. You could set ignoreStrings="," on the math input. Then, before it even sends the result to be parsed, it simply removes the commas from what the user entered. With this flag, 30000, 30,000, 300,00, and ,3,0,0,,,0,0, would all parse to 30000.

I definitely want the ability to separate multiple answers by commas, so that makes sense.

I tried <mathInput ignoreStrings=","> and I got an error. Can you give me an example of how to use ignoreStrings?

And as a follow up, how do I print $30,000 if I generated that number by doing something like

<m>\$<math simplify> $a*10000</math></m>.

My bad, it is removeStrings! E.g., <mathInput removeStrings=","></mathInput>.

You can use <intComma>, which will turn a number into a string with comma separators.

$<intComma><math simplify> $a*10000</math></intComma>

You can wrap it with an <m>, as well, if you don’t mind the space that latex renders after the comma.