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
ASCII and
Unicode code point U+0024 (in Unicode's
Latin-1 block inherited from
ASCII). though it has been requested formally. Where there is any risk of misunderstanding, the
ISO 4217 three-letter acronym is used.
Japanese The character is a
squared word version of ( "dollar", in Japanese). The character has been formerly
repurposed as a symbol for dollars in Japan because of its visual similarity. It was also
read as Programming languages • In
BASIC, is appended to a
variable name to define that variable’s
data type as a
character string, for example, H$="Hello, world!". In discussion, the variable H$ would be referred to as “H string.” • is prefixed to names to define
variables in the
PHP language and the
AutoIt automation script language,
scalar variables in the
Perl language (see
sigil (computer programming)), and global variables in the
Ruby language. In Perl programming this includes scalar elements of
arrays and
hashes {{code|2=perl|$hash{foo} }}. • In
Unix shells, and later in other programming languages, introduces an expression that should be evaluated to yield text. Languages that have adopted this convention include
Perl,
JavaScript,
C#,
Scala,
Groovy and
Kotlin. Other languages, including
Java and
Python, use it to mark the place where the result of an expression elsewhere should be inserted into text. • is used for defining hexadecimal constants in some variants of
assembly language (such as the Motorola 6800, Motorola 68000 and MOS Technology 6502 assembly languages), in
Pascal and in Pascal-like languages such as
Free Pascal and
Delphi. • 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, 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. • 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 . The
Prototype.js library defines it similarly for querying. • 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
Java, can appear inside a class name in a
Java class file due to
name mangling. For example, if a class Outer has an inner class Inner, the compiled class file will be named Outer$Inner.class. • 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 or 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 (programming language from Kx Systems), the sign is used as a casting/padding/enumeration/conditional operator. • In
Sass, the sign is prefixed to define a variable. • In
Svelte, the sign can be used to mark
reactive statements.
Operating systems • In
CP/M and subsequently in all versions of
86-DOS and
MS-DOS compatible operating systems, marks the end of text displayed with system function 9. CP/M developer
Gary Kildall never explained the choice and once pointedly remarked that he knew the reason while
Bill Gates did not. Prior uses of for the "end of line" or "end of text" include
JOVIAL,
CMS-2, the
QED editor and
DECsystem-10 (a known influence on CP/M), which displayed the character to confirm that the user pressed the
escape key to complete a line of input. • In
Windows, is appended to the share name to hide a shared folder or resource. For example, will be visible to other computers on a network, while 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 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., , , 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.
Applications •
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, as well as the end of a line or the file in text editors
ed,
ex,
vi,
pico, and derivatives. ==Other uses==