# Question about dollar sign coding

**URL:** <https://boards.straightdope.com/t/question-about-dollar-sign-coding/1028497>\
**Category:** About This Message Board\
**Created:** [March 16, 2026, 5:28pm UTC](https://boards.straightdope.com/t/question-about-dollar-sign-coding/1028497 "2026-03-16T17:28:23Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![pjd](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/pjd/32/3009_2.png) [@pjd](https://boards.straightdope.com/u/pjd)\
**Post date:** [March 16, 2026, 6:26pm UTC](https://boards.straightdope.com/t/question-about-dollar-sign-coding/1028497/21 "2026-03-16T18:26:14Z")

</div>

I use it every day !  
\bbox[silver,5px,border:1px solid black]{\texttt H}\bbox[silver,5px,border:1px solid black]{\texttt O}\bbox[silver,5px,border:1px solid black]{\texttt I}\bbox[yellow,5px,border:1px solid black]{\texttt S}\bbox[silver,5px,border:1px solid black]{\texttt T}  
\bbox[lime,5px,border:1px solid black]{\texttt S}\bbox[silver,5px,border:1px solid black]{\texttt C}\bbox[yellow,5px,border:1px solid black]{\texttt A}\bbox[silver,5px,border:1px solid black]{\texttt L}\bbox[silver,5px,border:1px solid black]{\texttt E}  
\bbox[lime,5px,border:1px solid black]{\texttt S}\bbox[lime,5px,border:1px solid black]{\texttt P}\bbox[lime,5px,border:1px solid black]{\texttt R}\bbox[lime,5px,border:1px solid black]{\texttt A}\bbox[lime,5px,border:1px solid black]{\texttt Y}

---

<div class="post-metadata">

**Author:** ![Eyebrows\_0f\_Doom](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/eyebrows_0f_doom/32/3119_2.png) [@Eyebrows\_0f\_Doom](https://boards.straightdope.com/u/Eyebrows_0f_Doom)\
**Post date:** [March 16, 2026, 6:27pm UTC](https://boards.straightdope.com/t/question-about-dollar-sign-coding/1028497/22 "2026-03-16T18:27:02Z")

</div>

> [@Dinsdale](#):
>
> test:
> 
> 200 and then addl spent.
> 
> On edit: intended “two hundred dollars and then addl dollars spent.”
> 
> Once it “corrects” the formatting, I could not figure out how to get rid of it. Makes me fondly recall wordperfect’s “reveal codes” way back when…

Just delete the second $ and it immediately removes the formatting… 🤷

---

<div class="post-metadata">

**Author:** ![bordelond](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/bordelond/32/150_2.png) [@bordelond](https://boards.straightdope.com/u/bordelond)\
**Post date:** [March 16, 2026, 6:29pm UTC](https://boards.straightdope.com/t/question-about-dollar-sign-coding/1028497/23 "2026-03-16T18:29:30Z")

</div>

> [@pjd](#):
>
> I use it every day !

No way you typed all that out 😅

---

<div class="post-metadata">

**Author:** ![pjd](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/pjd/32/3009_2.png) [@pjd](https://boards.straightdope.com/u/pjd)\
**Post date:** [March 16, 2026, 6:32pm UTC](https://boards.straightdope.com/t/question-about-dollar-sign-coding/1028497/24 "2026-03-16T18:32:16Z")

</div>

Of course not !  
(I wrote a program to do it all. I just type in the words !!)

---

<div class="post-metadata">

**Author:** ![gnoitall](https://avatars.discourse-cdn.com/v4/letter/g/bb73d2/32.png) [@gnoitall](https://boards.straightdope.com/u/gnoitall)\
**Post date:** [March 16, 2026, 6:44pm UTC](https://boards.straightdope.com/t/question-about-dollar-sign-coding/1028497/25 "2026-03-16T18:44:09Z")

</div>

> [@bordelond](#):
>
> Is that the mathematical-formula coding?

I believe it is.

> **[Math](https://www.discourse.org/plugins/math)**
>
> Display mathematical notation in posts using LaTeX.

> **[Discourse Math](https://meta.discourse.org/t/discourse-math/65770)**
>
> :discourse2: Summary Discourse Math uses MathJax (default) or KaTeX to render maths in your Discourse forum. 📖 Install Guide This plugin is bundled with Discourse core. There is no need to install the plugin separately. Enabling Math The...

The example they give:

```auto
$$
\sqrt{(-1)} \; 2^3 \; \sum \; \pi
$$

```

\sqrt{(-1)} \; 2^3 \; \sum \; \pi

---

<div class="post-metadata">

**Author:** ![ParallelLines](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/parallellines/32/3575_2.png) [@ParallelLines](https://boards.straightdope.com/u/ParallelLines)\
**Post date:** [March 16, 2026, 6:44pm UTC](https://boards.straightdope.com/t/question-about-dollar-sign-coding/1028497/26 "2026-03-16T18:44:10Z")

</div>

> [@Dinsdale](#):
>
> I think it is when you use multiple $ in a single sentence? Paragraph? Post? I don’t know what triggers it until I hit submit and see a mess of italicized gibberish - which I am unable to edit/correct.

I’m pretty sure that enough $ in close proximately active the MathJax (or latest equivalent) parsing in discourse. I’ve had it happen a few times.

---

<div class="post-metadata">

**Author:** ![Dinsdale](https://avatars.discourse-cdn.com/v4/letter/d/97f17d/32.png) [@Dinsdale](https://boards.straightdope.com/u/Dinsdale)\
**Post date:** [March 16, 2026, 6:55pm UTC](https://boards.straightdope.com/t/question-about-dollar-sign-coding/1028497/27 "2026-03-16T18:55:23Z")

</div>

> [@Eyebrows\_0f\_Doom](#):
>
> Just delete the second $ and it immediately removes the formatting…

I don’t think it is that easy. I just typed in another post:

“billions of () disappear, billions of () of munitions need to be replenished…”

Parens added to avoid formatting.

It came out with the nonsensical compacted itals. On edit, I could not see everything I had typed. The end was cur off. So I went to the end of the portion that was designated - whatever (I forget). It deleted the italicization, but also a good portion of the material between the dollar signs.

> [@gnoitall](#):
>
> The example they give:

Curious that they give TWO dollar signs in their example ($$), because what I describe occurs when using only a single dollar sign.

Is this really an improvement over the old [url] coding using brackets?

ON EDIT - I typed ($) twice - both places where italicized () appear. So the second dollar sign was not followed by a space.

---

<div class="post-metadata">

**Author:** ![DPRK](https://avatars.discourse-cdn.com/v4/letter/d/4491bb/32.png) [@DPRK](https://boards.straightdope.com/u/DPRK)\
**Post date:** [March 16, 2026, 8:12pm UTC](https://boards.straightdope.com/t/question-about-dollar-sign-coding/1028497/28 "2026-03-16T20:12:38Z")

</div>

The mathematics stuff is not a URL; it runs it through a JavaScript display engine.

---

<div class="post-metadata">

**Author:** ![Topologist](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/topologist/32/3208_2.png) [@Topologist](https://boards.straightdope.com/u/Topologist)\
**Post date:** [March 16, 2026, 8:56pm UTC](https://boards.straightdope.com/t/question-about-dollar-sign-coding/1028497/29 "2026-03-16T20:56:23Z")

</div>

> [@Dinsdale](#):
>
> Curious that they give TWO dollar signs in their example ($$), because what I describe occurs when using only a single dollar sign.

I suppose you have to be used to using \LaTeX for this all to make sense. Text surrounded by single dollar signs get converted to inline math like this: e^{i\pi} = -1. Text surrounded by double dollar signs gets converted to displayed math, math displayed on its own line, like this:

e^{i\theta} = \cos\theta + i\sin\theta.

If you want to use dollar signs just as normal dollar signs, you’d be better off remembering to type `\$` rather than trying to figure out when the parser will guess you’re trying to do inline math and when it realizes you’re just trying to type a darn $.

---

<div class="post-metadata">

**Author:** ![Thudlow\_Boink](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/thudlow_boink/32/320_2.png) [@Thudlow\_Boink](https://boards.straightdope.com/u/Thudlow_Boink)\
**Post date:** [March 16, 2026, 9:01pm UTC](https://boards.straightdope.com/t/question-about-dollar-sign-coding/1028497/30 "2026-03-16T21:01:40Z")

</div>

It’s essentially the same as with asterisks.

Anything between two asterisks gets italicized. If you want actual asterisks to appear instead, type backslash-asterisk.

---

<div class="post-metadata">

**Author:** ![LSLGuy](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lslguy/32/5813_2.png) [@LSLGuy](https://boards.straightdope.com/u/LSLGuy)\
**Post date:** [March 16, 2026, 9:03pm UTC](https://boards.straightdope.com/t/question-about-dollar-sign-coding/1028497/31 "2026-03-16T21:03:04Z")

</div>

'Zactly. @Topologist has the first end-to-end complete correct answer.

If you want multiple dollar signs in a paragraph, always “escape” them by putting \$ instead of just $.

You can always safely use just one $ in a paragraph without concern. But as soon as there are two or more, the smart money is to simply use \$, not just $.

And if you do screw up and see italics or a mess or whatever in your post that you did not intend, it’s easy to edit it to fix that. Just add \ in front of all the $s, click [save edit] and your post is back to normal appearance.

---

<div class="post-metadata">

**Author:** ![Dinsdale](https://avatars.discourse-cdn.com/v4/letter/d/97f17d/32.png) [@Dinsdale](https://boards.straightdope.com/u/Dinsdale)\
**Post date:** [March 16, 2026, 9:12pm UTC](https://boards.straightdope.com/t/question-about-dollar-sign-coding/1028497/32 "2026-03-16T21:12:05Z")

</div>

> [@LSLGuy](#):
>
> And if you do screw up and see italics or a mess or whatever in your post that you did not intend, it’s easy to edit it to fix that. Just add \ in front of all the $s, click [save edit] and your post is back to normal appearance.

I’m sure that is the case, but I am just blind to it. Because as I said upthread, when I tried to edit my posts, it did not display the entire post - with dollar signs, such that I could insert slashes, delete spaces, or whatever.

I would think that whatever geniuses came up with this mathematical shortcut/benefit/whatever could have chosen some less frequently used symbol - or combination of keystrokes - to display math. Let the geniuses who are trying to show math and know about codes to do that be the people to internalize some special combination of keystrokes - maybe control-$. Instead of tripping up yokels like yours truly who is just trying to represent dollar signs as I would on a typewriter.

---

<div class="post-metadata">

**Author:** ![gnoitall](https://avatars.discourse-cdn.com/v4/letter/g/bb73d2/32.png) [@gnoitall](https://boards.straightdope.com/u/gnoitall)\
**Post date:** [March 16, 2026, 9:22pm UTC](https://boards.straightdope.com/t/question-about-dollar-sign-coding/1028497/33 "2026-03-16T21:22:38Z")

</div>

> [@Dinsdale](#):
>
> maybe control-$

There’s no such entity.

It has to be some combination of valid Unicode glyphs stored in the post and interpreted at display time (i.e., “symbols” in your suggestion, rather than “keystroke”).

But for the life of me, I’ve never encountered a non-silly use for multiple dollar sign characters, so IMHO this is as unobtrusive as it needs to be.

Obviously, YMMV.

---

<div class="post-metadata">

**Author:** ![Topologist](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/topologist/32/3208_2.png) [@Topologist](https://boards.straightdope.com/u/Topologist)\
**Post date:** [March 16, 2026, 9:33pm UTC](https://boards.straightdope.com/t/question-about-dollar-sign-coding/1028497/34 "2026-03-16T21:33:21Z")

</div>

> [@Dinsdale](#):
>
> I would think that whatever geniuses came up with this mathematical shortcut/benefit/whatever could have chosen some less frequently used symbol

The original genius who came up with it was the computer scientist Donald Knuth around 1978. The short version is that he was unhappy with the typical typsetting of technical books at the time so designed his own typesetting program, \TeX, to typeset the next edition of his textbook, _The Art of Computer Programming_. Over the years, \TeX and its variant \LaTeX have become _the_ typesetting tools for computer science, math, and several other fields.

Because computer scientists and mathematicians don’t write about money that much, Knuth chose the dollar sign as the symbol to indicate text that should be typeset as math. Do we need to stick with that on a general purpose board like this? There are alternatives, but remember that the people who program these things are the same ones used to using \TeX and used to using dollar signs this way, so went with what they know.

---

<div class="post-metadata">

**Author:** ![Dinsdale](https://avatars.discourse-cdn.com/v4/letter/d/97f17d/32.png) [@Dinsdale](https://boards.straightdope.com/u/Dinsdale)\
**Post date:** [March 16, 2026, 9:33pm UTC](https://boards.straightdope.com/t/question-about-dollar-sign-coding/1028497/35 "2026-03-16T21:33:32Z")

</div>

> [@gnoitall](#):
>
> But for the life of me, I’ve never encountered a non-silly use for multiple dollar sign characters, so IMHO this is as unobtrusive as it needs to be.

I guess my manner of posting is silly, then.

---

<div class="post-metadata">

**Author:** ![gnoitall](https://avatars.discourse-cdn.com/v4/letter/g/bb73d2/32.png) [@gnoitall](https://boards.straightdope.com/u/gnoitall)\
**Post date:** [March 16, 2026, 9:37pm UTC](https://boards.straightdope.com/t/question-about-dollar-sign-coding/1028497/36 "2026-03-16T21:37:59Z")

</div>

Your pre-edit examples worked just fine, which is obviously why you chose to edit.

Quoting from the Discourse Meta post I linked earlier:

> [@](#):
>
> Discourse Math uses a heuristic to ensure that sentences such as: “I spent 20$ and another 100$” do not get converted.

Is the detection heuristic perfect? Probably not. In which case, a sufficiently weird use of a single dollar sign might be misunderstood by the detection logic as a single-dollar-sign inline math expression and render in an unintended manner.

But AFAICT, any standard usage of a dollar sign seems to work OK, and if there’s a non-standard usage that trips the math text processing ability, it’s immediately obvious in preview and easily to fix with a single backslash.

I won’t pretend to understand, or defend, why they chose the dollar sign glyph for this. Perhaps some historical precedent from other uses of LaTEX typography. But it appears to be unchangeable, and the addon seems sufficiently popular here to prevent turning it off. Probably.

ETA: I’ve reported original post to be moved into Site Feedback, since this is a technical discussion about a Discourse feature. And also, I think that forum is monitored by Discourse developers and @Dinsdale’s opinion counts as valid feedback to the devs.

---

<div class="post-metadata">

**Author:** ![Dinsdale](https://avatars.discourse-cdn.com/v4/letter/d/97f17d/32.png) [@Dinsdale](https://boards.straightdope.com/u/Dinsdale)\
**Post date:** [March 16, 2026, 9:46pm UTC](https://boards.straightdope.com/t/question-about-dollar-sign-coding/1028497/37 "2026-03-16T21:46:59Z")

</div>

> [@gnoitall](#):
>
> But AFAICT, any standard usage of a dollar sign seems to work OK, and if there’s a non-standard usage that trips the math text processing ability, it’s immediately obvious in preview and easily to fix with a single backslash.

I probably ought to start using preview. I don’t even know where it is, and I don’t readily imagine that the formatting will be changed from what I typed and see in the window. And today is the first time I’ve heard of the magic backslash.

I imagine that I may tend to use a dollar sign as shorthand for money or dollars. So if I am typing a sentence/paragraph and after presenting a dollar amount with a dollar sign I later just type a dollar sign with a space before and after, that might get (mis) interpreted as a desire to format.

Given how common on-line abbreviations and emojis are, using $ to represent the word “dollars” or “money” does not impress me as insane.

---

<div class="post-metadata">

**Author:** ![LSLGuy](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lslguy/32/5813_2.png) [@LSLGuy](https://boards.straightdope.com/u/LSLGuy)\
**Post date:** [March 16, 2026, 9:48pm UTC](https://boards.straightdope.com/t/question-about-dollar-sign-coding/1028497/38 "2026-03-16T21:48:04Z")

</div>

> [@gnoitall](#):
>
> But for the life of me, I’ve never encountered a non-silly use for multiple dollar sign characters, so IMHO this is as unobtrusive as it needs to be.

The issue is _not_ multiple adjacent $ characters. Or at least it’s not _just_ multiple adjacent $ characters.

It’s multiple $ characters appearing nearly anywhere in the same paragraph. Which are often (net of that heuristic) treated as [start LaTex encoding] and [stop LaTex encoding] symbols. If Knuth had chosen different symbols for start and end things might have been better. But also Markdown uses \*\* as both [start bold] and [end bold], so it’s in good company.

There is no good answer to an inline markup language that is both easy for non-technical but semi-skilled users to enter & remember and also be devoid of traps for even less technical / skilled users than average. e.g., “I meant two stars. How come I got bold?” is a thing. But only with very very, very noobs.

---

<div class="post-metadata">

**Author:** ![Dinsdale](https://avatars.discourse-cdn.com/v4/letter/d/97f17d/32.png) [@Dinsdale](https://boards.straightdope.com/u/Dinsdale)\
**Post date:** [March 16, 2026, 9:49pm UTC](https://boards.straightdope.com/t/question-about-dollar-sign-coding/1028497/39 "2026-03-16T21:49:18Z")

</div>

> [@gnoitall](#):
>
> ETA: I’ve reported original post to be moved into Site Feedback, since this is a technical discussion about a Discourse feature.

Fuck - please don’t do that. I already have a hard enough time with the (IMO largely BS) practices about what can be posted in what manner in which forum, and what is or isn’t a hijack. All I need is for my posts to be cornfielded into some forum I don’t know if I have ever opened.

---

<div class="post-metadata">

**Author:** ![gnoitall](https://avatars.discourse-cdn.com/v4/letter/g/bb73d2/32.png) [@gnoitall](https://boards.straightdope.com/u/gnoitall)\
**Post date:** [March 16, 2026, 9:51pm UTC](https://boards.straightdope.com/t/question-about-dollar-sign-coding/1028497/40 "2026-03-16T21:51:15Z")

</div>

Markdown is a thing, but noobs won’t know what that is until they encounter it.

The visual editor mode should eliminate all of these issues. AFAIK, switching to visual editor (rather than markdown editor mode) eliminates the editor treating specific keystrokes as magic format markers. (Formatting is applied using menu options and not visible in the editor text window; the editing window is its own preview, and every character keyed in is a visible glyph.)

[Previous page](https://boards.straightdope.com/t/question-about-dollar-sign-coding/1028497.md?page=1)

[Next page](https://boards.straightdope.com/t/question-about-dollar-sign-coding/1028497.md?page=3)
