Heuristic for dollar amounts doesn't work

AI-generated summary

The discussion Heuristic for dollar amounts doesn’t work started with Roymond experiencing issues with Discourse Math’s heuristic for dollar amounts, where it incorrectly converted text to math mode. Specifically, the heuristic worked for $400 but not for $210 in the same paragraph as a formula. Falco suggested escaping the dollar signs with a backslash \ to prevent this issue, which Roymond confirmed worked. Falco further explained that using the backslash as a universal escape character can help resolve such formatting problems.

The site says: “Discourse Math uses a heuristic to ensure that sentences such as: “I spent 20$ and another 100$” do not get converted.”

I am writing a discussion that involves dollar amounts. In one paragraph there is $400 and later 210, then one sentence later a formula (amount)*s^2$. The software is treating everything between “$210” and "… formula as math, leaving the actual formula in basic text.
Writing 400$ or 210$ is incorrect in the first place.

What really baffles me is why the in front of 210 triggers the math mode but the in front of 400 does not.

Anyway, is there a solution to this?

Problem text:

$400 and later 210, then one sentence later a formula (amount)*s^2$.

Try escaping like

\$400 and later \$210, then one sentence later a formula $(amount)*s^2$.

so it becomes

$400 and later $210, then one sentence later a formula (amount)*s^2.

Looks like our heuristic works, but the formula at the same paragraph is too much for it to handle.

Yay!

I never would have found that – thanks.

The trick is knowing the \ is the universal escape character, and then adding \ until the preview looks just right.