A symbol representing several widely-used monetary units
The dollar sign or peso sign (or $) is a symbol used to indicate the units of various currencies around the world, particularly most currencies denominated in pesos and dollars. The symbol can interchangeably have one or two vertical strokes. In common usage, the sign appears to the left of the amount specified, e.g. "$1", read as "one dollar".
Development of the dollar sign, according to the best documented hypothesis (top) and one alternative hypothesis (bottom)
There are several hypotheses about the origin of the dollar sign. It is first attested in American, Canadian, Mexican, Spanish American, and other British business correspondence in the 1770s referring to the Spanish American peso, also known as "Spanish dollar" or "piece of eight" in America, which provided the model for the currency that the United States adopted in 1792 and the larger coins of the new Spanish American republics, such as the Mexican peso, Peruvian real, and Bolivian sol coins. This explanation holds that the sign grew out of the Spanish and Spanish American scribal abbreviation "pˢ" for pesos. A study of late eighteenth- and early nineteenth-century manuscripts shows that the s gradually came to be written over the p, developing into a close equivalent to the "$" mark. A variation of this hypothesis derives the sign from a combination of the Greek character "psi" (ψ) and "S".
With the Coinage Act of 1792, the United States Congress created the U.S. dollar, defining it to have "the value of a Spanish milled dollar as the same is now current" but continued to use a variety of foreign coins until the Coinage Act of 1857 declared them illegal. These US dollar coins did not have any dollar symbol.
Several alternative hypotheses relate specifically to the dollar sign drawn with two vertical lines. A dollar sign with two vertical lines could have started off as a monogram of "USA" used on money bags issued by the United States Mint. The letters U and S superimposed resemble the historical double-stroke dollar sign . The bottom of the U disappears into the bottom curve of the S, leaving two vertical lines. Dr. James Alton James was a professor of history at Northwestern University from 1897 to 1935, and he postulated that the symbol with two strokes was an adapted design of patriot Robert Morris in 1778.
The $1 United States Note issued by the United States in 1869 included a symbol consisting of a partially overlapped U and S, with the right bar of the U intersecting the S, as well as the double-stroke dollar sign in the legal warning against forgery. Another hypothesis is that it is derived from the symbol used on a German Thaler. A similar symbol of superimposing S and I or J was used to denote the German Joachimsthaler which appeared in the 1686 ion of An Introduction to Merchants' Accounts by John Collins.
Use in computer software
Because of its use in early American computer applications such as business accounting, the dollar sign is almost universally present in computer character sets, and thus has been appropriated for many purposes unrelated to money in programming languages and command languages.
The dollar sign "$" has Unicode code point U+0024 (inherited from ASCII via Latin-1).
U+0024 $DOLLAR SIGN (HTML $·$) ($ in HTML5)
There are no separate encodings for one- and two-line variants. The choice is typeface-dependent, they are allographs.
There are also three other code points that originate from other East Asian standards: the Taiwanese small form variant, the CJK fullwidth form, and the Japanese emoji. The glyphs for these code points are typically larger or smaller than the primary code point, but the difference is mostly aesthetic or typographic, and the meanings of the symbols are the same.
In ASP.NET, the dollar sign 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.
In Erlang, the dollar sign precedes character literals. The dollar sign as a character can be written $$.
In COBOL the $ sign is used in the Picture clause to depict a floating currency symbol as the left most character. The default symbol is $; however, if the CURRENCY= or CURRENCY SIGN clause is specified, many other symbols can be used.
In Sass, the $ sign is prefixed to define a variable.
In CP/M and subsequently in all versions of DOS (86-DOS, MS-DOS, PC DOS, more) and derivatives, $ is used as a string terminator (Int 21h with AH=09h).
$ is used by the prompt command to insert special sequences into the DOS command prompt string.
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. Hiding a shared folder or resource will not alter its access permissions but may render it inaccessible to programs or other functions which rely on its visibility. Most administrative shares are hidden in this way.
In Unix-like systems the $ is often part of the command prompt, depending on the user's shell and environment settings. For example, the default environment settings for the bash shell specify $ as part of the command prompt.
The using history expansion!$ (same as !!1$ and !-1$) means the last argument of the previous command in bash: !-2$ expands to the last argument of the penultimate command, !5$ expands into the last argument of the fifth command and so on. For example:
> touch my_first_file
> echo"This is my file." > !$
where !$ expands into my_first_file.
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". It is appended to entities such as the names of system files, the "sender" name in messages sent by the operator, and the default names of system-created files (like compiler output) when no specific name is specified (e.g., TPF$, NAME$, etc.)
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 the dollar sign ($) to denote a fixed row, fixed column reference, or an absolute cell reference.
Because the one bar version and the two bar version are allographs, any given font will contain one style or the other, not both. Furthermore, an electronic document written using one style may be viewed subsequently with the other style, because of font substitution. Consequently, when distinction is critical, it is best to use the three-letter acronym (USD, MXN etc, see ISO 4217).
However, in Argentina, the $ sign is always used for pesos, and if they want to indicate dollars, they always write U$S 5 or US$5 (5 US dollars).
In the United States, Mexico, Australia, Argentina, New Zealand, Hong Kong, Pacific Island nations, and English-speaking Canada, the dollar or peso symbol precedes the number. Five dollars or pesos is written and printed as $5, whereas five cents is written as 5¢. In French-speaking Canada, the dollar symbol usually appears after the number (5$).
In games and virtual worlds
Some virtual world and gaming platforms have used the $ symbol to refer to their own virtual currencies, for example:
A dollar symbol is used as unit of reactivity for a nuclear reactor, 1$ being the threshold of slow criticality, meaning a steady reaction rate, while 2$ is the threshold of prompt criticality, which means a nuclear excursion or explosion.
^Nussbaum, Arthur (1957). A History of the Dollar. New York: Columbia University Press. p. 56. The foreign coins remained in circulation [in the United States], and the more important among them, especially the Spanish (including the Mexican) dollars, were declared by Congress on February 9, 1793, to be legal tender. The dollar sign, $, is connected with the peso, contrary to popular belief, which considers it to be an abbreviation of 'U.S.' The two parallel lines represented one of the many abbreviations of 'P,' and the 'S' indicated the plural. The abbreviation '$.' was also used for the peso, and is still used in Argentina.