Dollar sign
The dollar sign or peso sign is a symbol used to indicate the units of various currencies around the world, including the peso and the US dollar. 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".
Origin
There are several hypotheses about the origin of the dollar sign. It is first attested in Spanish American, American, Canadian, Mexican, 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".Pillars of Hercules
Another hypothesis holds that the sign is derived from the symbolic representation of the Pillars of Hercules. This representation can have either a banner separately around each pillar, or a banner curling between them, as in the Spanish coat of arms.The symbol was adopted by Charles V and was part of his coat of arms representing Spain's American possessions. The symbol was later stamped on coins minted in gold and silver. The Spanish dollar depicted the pillars over two hemispheres and a small "S"-shaped ribbon around each. They were spread throughout America, Europe, and Asia. According to this theory, traders wrote signs that had this symbol, and this in turn developed into a simple S with two vertical bars.
With the Coinage Act of 1792, the United States Congress created the US 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.
Mexico continued to use the Spanish dollar until after the Mexican War of Independence.
Drawn with two vertical lines
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 overlapping U and S, with one of the bars 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 edition 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.Encoding
The dollar sign "$" has Unicode code point U+0024.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.
However, for usage as the special character in various computing applications, U+0024 is typically the only code that is recognized.
Programming languages
- $ was used for defining string variables in older versions of the BASIC language, eg. CHR$.
- $ is used for defining hexadecimal constants in Pascal-like languages such as Delphi, and in some variants of assembly language.
- $ is prefixed to names to define variables in the PHP language and the AutoIt automation script language, scalar variables in the Perl language, and global variables in the Ruby language. In Perl programming this includes scalar elements of arrays $array and hashes $hash.
- In most shell scripting languages, $ is used for interpolating environment variables, special variables, arithmetic computations, and special characters, and for performing translation of localised strings. Christopher Stratchey's GPM, the inspiration for the Multics shell, used the non-ASCII symbol § for macro expansion.
- $ is used in the ALGOL 68 language to delimit transput format regions.
- $ is used in the TeX typesetting language to delimit mathematical regions.
- In many versions of FORTRAN 66, $ could be used as an alternative to a quotation mark for delimiting strings.
- In PL/M, $ can be used to put a visible separation between words in compound identifiers. For example, 'Some$Name' refers to the same thing as 'SomeName'.
- In 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.
- In several JavaScript frameworks such as Prototype.js and jQuery, $ is a common utility class, and is often referred to as the buck.
- In JavaScript from ES6 onward it is used inside template literals to insert the value of a variable. For example, if var word = "such" then `as $` would equal 'as such'
- In C#, $ marks a string literal as an interpolated string.
- 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 some assembly languages, such as MIPS, the $ sign is used to represent registers.
- In Honeywell 6000 series assembler, the $ sign, when used as an address, meant the address of the instruction in which it appeared.
- In CMS-2, the $ sign is used as a statement terminator.
- In R, the $ sign is used as a subsetting operator.
- In Q, the $ sign is used as a casting/padding/enumeration/conditional operator.
- In Sass, the $ sign is prefixed to define a variable.
Operating systems
- In CP/M and subsequently in all versions of DOS and derivatives, $ is used as a string terminator.
- * $ 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
!$
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:
> echo "This is my 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 when no specific name is specified
- 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.Applications
- Microsoft Excel and other spreadsheet software use the dollar sign to denote a fixed row, fixed column reference, or an absolute cell reference.
- The dollar sign introduces a subfield delimiter in computer coding of library catalog records.
- $ matches the end of a line or string in sed, grep, and POSIX and Perl regular expressions, and, as a result:
- $ signifies the end of a line or the file in text editors ed, ex, vi, pico, and derivatives.
Currencies that use the dollar or peso sign
An exception is the Philippine peso, whose sign is written as ₱.
The dollar sign is also still sometimes used to represent the Malaysian ringgit, though its official use to represent the currency has been discontinued since 1993.
Some currencies use the cifrão, similar to the dollar sign, but always with two strokes:
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.
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.
In games and virtual worlds
Some virtual world and gaming platforms have used the $ symbol to refer to their own virtual currencies, for example:- R$ – Robux
- S$ – Sansar Dollars
- L$ – Linden Dollars
Other uses
In Scrabble notation, a dollar sign is placed after a word to indicate that it is valid according to the North American word lists, but not according to the British word lists.
The dollar sign was used as a letter in Turkmen alphabet from 1993 to 1999.