# Heuristic for dollar amounts doesn't work

**URL:** https://meta.discourse.org/t/heuristic-for-dollar-amounts-doesnt-work/361468
**Category:** Support
**Tags:** math
**Created:** [April 11, 2025, 6:30pm UTC](https://meta.discourse.org/t/heuristic-for-dollar-amounts-doesnt-work/361468 "2025-04-11T18:30:22Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Roymond](https://avatars.discourse-cdn.com/v4/letter/r/c77e96/32.png) [@Roymond](https://meta.discourse.org/u/Roymond)
#### Post date: [April 11, 2025, 6:30pm UTC](https://meta.discourse.org/t/heuristic-for-dollar-amounts-doesnt-work/361468/1 "2025-04-11T18:30:22Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [April 11, 2025, 6:45pm UTC](https://meta.discourse.org/t/heuristic-for-dollar-amounts-doesnt-work/361468/2 "2025-04-11T18:45:53Z")

</div>

Problem text:

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

Try escaping like

```plaintext
\$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.

---

<div class="post-metadata">

### Author: ![Roymond](https://avatars.discourse-cdn.com/v4/letter/r/c77e96/32.png) [@Roymond](https://meta.discourse.org/u/Roymond)
#### Post date: [April 12, 2025, 10:27pm UTC](https://meta.discourse.org/t/heuristic-for-dollar-amounts-doesnt-work/361468/3 "2025-04-12T22:27:01Z")

</div>

Yay!

I never would have found that – thanks.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [April 14, 2025, 2:45pm UTC](https://meta.discourse.org/t/heuristic-for-dollar-amounts-doesnt-work/361468/4 "2025-04-14T14:45:50Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [May 14, 2025, 2:46pm UTC](https://meta.discourse.org/t/heuristic-for-dollar-amounts-doesnt-work/361468/5 "2025-05-14T14:46:32Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
