Dollar sign

Updated: 09/12/2023 by Computer Hope
Dollar sign

A dollar sign ($) is the symbol found on the same key as the number four (4) key on United States QWERTY keyboard. The dollar sign represents a U.S. currency value, e.g., $10.00 for ten dollars. As seen in the picture, the dollar sign looks like the letter "S" with a vertical line going through the middle.

Where is the dollar sign key on the keyboard?

Below is an overview of a computer keyboard with the dollar sign key highlighted in blue.

Dollar sign key

How to create the $ symbol

Creating the $ symbol on a U.S. keyboard

To create the dollar sign symbol using a U.S. keyboard, hold down the Shift and press 4 at the top of the keyboard (Shift+4).

Tip

The Alt code Alt+36 also creates a dollar sign.

Creating the $ symbol on a smartphone or tablet

To create a tilde on a smartphone or tablet, open the keyboard, and go into the numbers (123) or symbols (sym) section, and tap the $ symbol.

What is a dollar sign used for on a computer?

In programming

In computer programming languages, the dollar sign has a wide variety of uses. In languages like BASIC, Pascal, and PHP (PHP: Hypertext Preprocessor), the dollar sign defines variables and constants. ALGOL (algorithmic language) 68 and TeX typesetting languages use the dollar sign for delimiting transput format and mathematical regions. ASP.NET uses the dollar sign to indicate an expression.

With a regular expression

When used in a regular expression, the dollar sign represents the end of the line or string. For example, in the following Perl code, if the user's input stored in the $input variable ends with the "example," it would print "I see example." to the screen. Otherwise, it would print "Missing example." to the screen.

if ($input =~ /example$/) {
 print "I see example.\n";
}
else {
 print "Missing example.\n";
}
Tip

In programs that support regular expressions in the find or search feature, you can add the $ symbol to the end of a search to find lines ending with specific text.

In applications

The dollar sign is also used in spreadsheet applications, like Microsoft Excel, and operating systems, like Microsoft Windows. For example, in the Windows operating system, users can hide shared folders by adding the dollar sign to the end of the folder's name. In Excel and other spreadsheet programs, the dollar sign is used in formulas to denote an absolute cell reference (e.g., =$D$4*A3).

In file names

A dollar sign or tilde and dollar sign (e.g., ~$example.doc) are used in the file name by some programs to identify temporary files.

Social networking

With social networking sites like Twitter and Reddit, the dollar is placed in front of a few capital letters to represent a stock symbol. For example, "$GME" to represent the stock symbol for GameStop.

Keyboard shortcut

The dollar sign key is used in keyboard shortcuts like Ctrl+Shift+$.

$1, ASP.NET, Constant, Currency, Number key, Shift+4, Spreadsheet, Symbol, Typography terms, Variable