For a few $ more
The dollar sign aka the peso sign, $1 is a currency symbol used to indicate the unit of various currencies around the world, including most currencies denominated “dollar” or “peso”.
Computers & Keyboards
Because of its use in early American computer applications such as business accounting, the $ sign is almost universally present in computer character sets. The most interesting fact in the computing and programming world is that the $ is appropriated for many purposes unrelated to money.
The $ plays a prominent character in programming languages that any Keyboard without the $ or replaced with another character would be detrimental to most programmers.
Via Wikipedia, here are a few instances;
- BASIC: $ is appended to a variable name to define that variable’s data type as a character string, for example,
H$="Hello, world!"
. - PHP: $ is prefixed to names to define variables.
- Perl: $ defines scalar variables.
- Ruby: $ defines global variables.
- In
*nix shells
and many other programming languages such as Perl, JavaScript, C#, Scala, Groovy and Kotlin, $ introduces an expression that should be evaluated to yield text. - Java and Python uses $ to mark the place where the result of an expression elsewhere should be inserted into text.
- Delphi uses $ to define hexadecimal constants.
- $ is used in the ALGOL 68 language to delimit transput format regions.
- TeX uses $ to delimit mathematical regions.
- FORTRAN 66 uses $ as an alternative to a quotation mark for delimiting strings.
- PL/M: $ can be used to put a visible separation between words in compound identifiers.
- Haskell: $ is used as a function application operator.
- In an AutoHotkey script, a hotkey declared with $ is not triggered by a
Send
command elsewhere in the script. - The jQuery library defines $ as its main symbol, primarily as a function that queries a web page for one or more HTML elements, but also with other utilities attached to it as properties like
$.ajax
. The Prototype.js library defines it similarly for querying. - ASP.NET: $ used in a tag in the web page indicates an expression will follow it. The expression that follows is .NET language-agnostic, as it will work with C#, VB.NET, or any CLR supported language.
- Erlang: $ precedes character literals.
- COBOL: $ sign is used in the Picture clause to depict a floating currency symbol as the left most character.
- In some assembly languages, such as MIPS, $ is used to represent registers.
- In Honeywell 6000 series assembler, $, when used as an address, meant the address of the instruction in which it appeared.
- CMS-2: $ is used as a statement terminator.
- R: $ is used as a subsetting operator.
- Q: $ is used as a casting/padding/enumeration/conditional operator.
- Sass: $ is prefixed to define a variable.
- Svelte: $ can be used to mark reactive statements.
- DOS: $ marks the end of text displayed with system function 9.
- In Microsoft Windows, $ is appended to the share name to hide a shared folder or resource. For example,
\\server\share
will be visible to other computers on a network, while\\server\share$
will be accessible only by explicit reference. - In the LDAP directory access protocol, $ is used as a line separator in various standard entry attributes such as postalAddress.
- In the UNIVAC EXEC 8 operating system, $ means “system”.
- In RISC OS, $ is used in system variables to separate the application name from the variables specific to that application. For example
Draw$Dir
specifies the directory where the!Draw
application is located. It is also used to refer to the root directory of a file system. - Microsoft Excel and other spreadsheet software use $ to denote a fixed row, fixed column reference, or an absolute cell reference.
- $ matches the end of a line or string in sed, grep, and POSIX and Perl regular expressions, as well as the end of a line or the file in text editors ed, ex, vi, pico, and derivatives.
- In extended Markdown that supports Mathematical functions tend to use the $ as beginning and ending delimiters.
Fun Fact
I was today years old learning that the $ symbol is used as the unit of reactivity for nuclear reactors — 0$
being the threshold of slow criticality (steady reaction rate) while 1$
is the threshold of prompt criticality (nuclear excursion or explosion).
-
The dollar sign, also known as the peso sign, is a currency symbol consisting of a capital ⟨S⟩ crossed with one or two vertical strokes ($ or Dollar sign with two vertical lines depending on typeface). In most English-speaking countries that use that symbol, it is placed to the left of the amount specified, e.g. “$1”, read as “one dollar”. ↩