Decimal separator

A decimal separator is a symbol used to separate the integer part from the fractional part of a number written in decimal form (e.g., "." in 12.45). Different countries officially designate different symbols for use as the separator. The choice of symbol also affects the choice of symbol for the thousands separator used in digit grouping.

Any such symbol can be called a decimal mark, decimal marker or decimal sign. Symbol-specific names are also used; decimal point and decimal comma refer to an (either baseline or middle) dot and comma respectively, when it is used as a decimal separator; these are the usual terms used in English,[1][2][3][4] with the aforementioned generic terms reserved for abstract usage.[5][6]

In many contexts, when a number is spoken, the function of the separator is assumed by the spoken name of the symbol: comma or point in most cases.[7][3][8] In some specialized contexts, the word decimal is instead used for this purpose (such as in International Civil Aviation Organization-regulated air traffic control communications). In mathematics, the decimal separator is a type of radix point, a term that also applies to number systems with bases other than ten.

In the Middle Ages, before printing, a bar ( ¯ ) over the units digit was used to separate the integral part of a number from its fractional part, as in 9995 (meaning 99.95 in decimal point format). A similar notation remains in common use as an underbar to superscript digits, especially for monetary values without a decimal separator, as in 9995. Later, a "separatrix" (i.e., a short, roughly vertical ink stroke) between the units and tenths position became the norm among Arab mathematicians (e.g. 99ˌ95), while an L-shaped or vertical bar (|) served as the separatrix in England.[9] When this character was typeset, it was convenient to use the existing comma (99,95) or full stop (99.95) instead.

Positional decimal fractions appear for the first time in a book by the Arab mathematician Abu'l-Hasan al-Uqlidisi written in the 10th century.[10] The practice is ultimately derived from the decimal Hindu-Arabic numeral system used in Indian mathematics,[11] and popularized by the Persian mathematician Al-Khwarizmi,[12] when Latin translation of his work on the Indian numerals introduced the decimal positional number system to the Western world. His presented the first systematic solution of linear and quadratic equations in Arabic.

Gerbert of Aurillac marked triples of columns with an arc (called a "Pythagorean arc"), when using his Hindu–Arabic numeral-based abacus in the 10th century. Fibonacci followed this convention when writing numbers, such as in his influential work Liber Abaci in the 13th century.[13] Tables of logarithms prepared by John Napier in 1614 and 1619 used the period (full stop) as the decimal separator, which was then adopted by Henry Briggs in his influential 17th century work.

In France, the full stop was already in use in printing to make Roman numerals more readable, so the comma was chosen.[14] Many other countries, such as Italy, also chose to use the comma to mark the decimal units position.[14] It has been made standard by the ISO for international blueprints.[15] However, English-speaking countries took the comma to separate sequences of three digits. In some countries, a raised dot or dash (upper comma) may be used for grouping or decimal separator; this is particularly common in handwriting.

In the United States, the full stop or period (.) was used as the standard decimal separator.

In the nations of the British Empire (and, later, the Commonwealth of Nations), the full stop could be used in typewritten material and its use was not banned, although the interpunct (a.k.a. decimal point, point or mid dot) was preferred as a decimal separator, in printing technologies that could accommodate it, e.g. 99·95.[17] However, as the mid dot was already in common use in the mathematics world to indicate multiplication, the SI rejected its use as the decimal separator.

During the beginning of British metrication in the late 1960s and with impending currency decimalisation, there was some debate in the United Kingdom as to whether the decimal comma or decimal point should be preferred: the British Standards Institution and some sectors of industry advocated the comma and the Decimal Currency Board advocated for the point. In the event, the point was chosen by the Ministry of Technology in 1968.[18]

When South Africa adopted the metric system, it adopted the comma as its decimal separator,[19] although a number of house styles, including some English-language newspapers such as The Sunday Times, continue to use the full stop.[citation needed]

The three most spoken international auxiliary languages, Ido, Esperanto, and Interlingua, all use the comma as the decimal separator. Interlingua has used the comma as its decimal separator since the publication of the Interlingua Grammar in 1951.[20] Esperanto also uses the comma as its official decimal separator, while thousands are separated by non-breaking spaces: 12 345 678,9. Ido's Kompleta Gramatiko Detaloza di la Linguo Internaciona Ido (Complete Detailed Grammar of the International Language Ido) officially states that commas are used for the decimal separator while full stops are used to separate thousands, millions, etc. So the number 12,345,678.90123 (in American notation) for instance, would be written 12.345.678,90123 in Ido. The 1931 grammar of Volapük by Arie de Jong uses the comma as its decimal separator, and—somewhat unusually—uses the middle dot as the thousands separator (12·345·678,90123).[21]

In 1958, disputes between European and American delegates over the correct representation of the decimal separator nearly stalled the development of the ALGOL computer programming language.[22] ALGOL ended up allowing different decimal separators, but most computer languages and standard data formats (e.g., C, Java, Fortran, Cascading Style Sheets (CSS)) specify a dot.

Previously, signs along California roads expressed distances in decimal numbers with the decimal part in superscript, as in 37, meaning 3.7.[23] Though California has since transitioned to mixed numbers with common fractions, the older style remains on postmile markers and bridge inventory markers.

The 22nd General Conference on Weights and Measures declared in 2003 that "the symbol for the decimal marker shall be either the point on the line or the comma on the line". It further reaffirmed that "numbers may be divided in groups of three in order to facilitate reading; neither dots nor commas are ever inserted in the spaces between groups"[24] (e.g. 1000000000). This usage has therefore been recommended by technical organizations, such as the United States' National Institute of Standards and Technology.[25]

Past versions of ISO 8601, but not the 2019 revision, also stipulated normative notation based on SI conventions, adding that the comma is preferred over the full stop.[26]

ISO 80000-1 stipulates that "The decimal sign is either a comma or a point on the line." The standard does not stipulate any preference, observing that usage will depend on customary usage in the language concerned, but adds a note that as per ISO/IEC Directives all ISO standards should use the decimal comma.

For ease of reading, numbers with many digits may be divided into groups using a delimiter,[27] such as comma "," or dot ".", half-space " ", space " ", underbar "_" (as in maritime "21_450") or apostrophe «'». In some countries, these "digit group separators" are only employed to the left of the decimal separator; in others, they are also used to separate numbers with a long fractional part. An important reason for grouping is that it allows rapid judgement of the number of digits, via subitizing (telling at a glance) rather than counting (contrast, for example, 100000000 with 100000000 for one hundred million).

Since 2003,[28] the use of spaces as separators (for example: 20000 and 1000000 for "twenty thousand" and "one million") has been officially endorsed by SI/ISO 31-0 standard,[29] as well as by the International Bureau of Weights and Measures and the International Union of Pure and Applied Chemistry (IUPAC),[30][31] the American Medical Association's widely followed AMA Manual of Style, and the Metrication Board, among others.

The groups created by the delimiters tend to follow the use of the local language, which varies. In European languages, large numbers are read in groups of thousands, and the delimiter—which occurs every three digits when it is used—may be called a "thousands separator". In East Asian cultures, particularly China, Japan, and Korea, large numbers are read in groups of myriads (10,000s) but the delimiter commonly separates every three digits.[citation needed] The Indian numbering system is somewhat more complex: it groups the rightmost three digits together (till the hundreds place) and thereafter groups by sets of two digits. For example, one trillion would thus be written as 10,00,00,00,00,000 or 10 kharab.[32]

The convention for digit group separators historically varied among countries, but usually seeking to distinguish the delimiter from the decimal separator. Traditionally, English-speaking countries employed commas as the delimiter – 10,000 – and other European countries employed periods or spaces: 10.000 or 10000. Because of the confusion that could result in international documents, in recent years the use of spaces as separators has been advocated by the superseded SI/ISO 31-0 standard,[29] as well as by the International Bureau of Weights and Measures and the International Union of Pure and Applied Chemistry, which have also begun advocating the use of a "thin space" in "groups of three".[30][31] Within the United States, the American Medical Association's widely followed AMA Manual of Style also calls for a thin space.[27] In some online encoding environments (for example, ASCII-only) a thin space is not practical or available, in which case a regular word space or no delimiter are the alternatives.

Digit group separators can occur either as part of the data or as a mask through which the data is displayed. This is an example of the separation of presentation and content, making it possible to display numbers with spaced digit grouping in a way that does not insert any whitespace characters into the string of digits in the content. In many computing contexts, it is preferred to omit digit group separators from the data and instead overlay them as a mask (an input mask or an output mask). Common examples include spreadsheets and databases in which currency values are entered without such marks but are displayed with them inserted. (Similarly, phone numbers can have hyphens, spaces or parentheses as a mask rather than as data.) In web content, such digit grouping can be done with CSS style. It is useful because the number can be copied and pasted into calculators (including a web browser's omnibox) and parsed by the computer as-is (i.e., without the user manually purging the extraneous characters). For example, Wikipedia content can display numbers this way, as in the following examples: 149597870700 metres is 1 astronomical unit, 3.14159265358979323846 is π rounded to 20 decimal places, and 2.71828182845904523536 is e rounded to 20 decimal places.

In some programming languages, it is possible to group the digits in the program's source code to make it easier to read; see Integer literal: Digit separators. Ada, C# (from version 7.0), D, Haskell (from GHC version 8.6.1), Java, OCaml, Perl, Python (from version 3.6), PHP (from version 7.4[33]), Ruby, Go (from version 1.13), Rust, Julia, and Swift use the underscore (_) character for this purpose; as such, these languages allow seven hundred million to be entered as 700_000_000. Fixed-form Fortran ignores whitespace (in all contexts), so 700 000 000 is permissible. C++14, Rebol, and Red allow the use of an apostrophe for digit grouping, so 700'000'000 is permissible.

The International Bureau of Weights and Measures states that "when there are only four digits before or after the decimal marker, it is customary not to use a space to isolate a single digit".[30] Likewise, some manuals of style state that thousands separators should not be used in normal text for numbers from 1,000 to 9,999 inclusive where no decimal fractional part is shown (in other words, for four-digit whole numbers), whereas others use thousands separators and others use both. For example, APA style stipulates a thousands separator for "most figures of 1,000 or more" except for page numbers, binary digits, temperatures, etc.

There are always "common-sense" country-specific exceptions to digit grouping, such as year numbers, postal codes and ID numbers of predefined nongrouped format, which style guides usually point out.

In binary (base-2), a full space can be used between groups of four digits, corresponding to a nibble, or equivalently to a hexadecimal digit. For integer numbers, dots are used as well to separate groups of four bits.[34] Alternatively, binary digits may be grouped by threes, corresponding to an octal digit. Similarly, in hexadecimal (base-16), full spaces are usually used to group digits into twos, making each group correspond to a byte.[35] Additionally, groups of eight bytes are often separated by a hyphen.[35]

In countries with a decimal comma, the decimal point is also common as the "international" notation because of the influence of devices, such as electronic calculators, which use the decimal point. Most computer operating systems allow selection of the decimal separator; programs that have been carefully internationalized will follow this, but some programs ignore it and a few may even fail to operate if the setting has been changed.

Computer interfaces may be set to the Unicode international "Common locale" using "LC_NUMERIC=C" as defined at Details of the current (2020) definitions may be found .

Unicode defines a decimal separator key symbol (⎖ in hex U+2396, decimal 9110) which looks similar to the apostrophe. This symbol is from ISO/IEC 9995 and is intended for use on a keyboard to indicate a key that performs decimal separation.

In the Arab world, where Eastern Arabic numerals are used for writing numbers, a different character is used to separate the integer and fractional parts of numbers. It is referred to as an Arabic decimal separator (U+066B, rendered: ٫‎) in Unicode. An Arabic thousands separator (U+066C, rendered: ٬‎) also exists. Example: ۹٬۹۹۹٫۹۹‎ (9,999.99)

In Persian, the decimal separator is called momayyez. The Unicode Consortium's investigation has concluded that "computer programs should render U+066B as a shortened, lowered, and possibly more slanted slash (٫); this should be distinguishable from the slash at the first sight." To separate sequences of three digits, an Arabic thousands separator (rendered as: ٬), a Latin comma, or a blank space may be used; however this is not a standard.[44][45][46] Example: ۹٬۹۹۹٫۹۹ (9,999.99)

In English Braille, the decimal point, , is distinct from both the comma, , and the full stop, .

The following examples show the decimal separator and the thousands separator in various countries that use the Arabic numeral system.