# Style: Numeric Fields

This topic accompanies the Styling Table Fields topic to provide reference detail on styling fields in tables for numeric data types.  Please review the Styling Table Fields topic for an introduction and step by step examples before proceeding with this topic.

## Numeric Styles

The Style dialog provides many options to display numbers, since numbers can be used to represent values such as longitudes and latitudes, which have their own variety of display formats, in addition to various ways of representing numbers.

Currency formatting takes the digit group separator, decimal point character, and monetary symbol from the language argument.   Negative values are shown within parentheses ( ) characters.

The Digits option specifies an optional number of decimal digits after the decimal point for the smallest unit in the format used.

The Positive degrees option is used when styling longitude and latitude values, with a choice such as N, E, S, and W specifying which hemisphere has positive angular values, with the opposite hemisphere using negative numbers.  When styling latitude numbers, choose N to apply the convention that positive numbers are North latitudes and negative numbers are South latitudes.  When styling longitude numbers, choose E to apply the convention that positive numbers are East longitudes and negative numbers are West longitudes.

Using a longitude value of 10.687 for the angle styles, and an example value of 123456.7890123 for other styles with an example language of en-US, the available styles are:

 (default) Fractional with all decimal digits by default: 123456.7890123 ad Angle in decimal degrees: 10.69º am Angle in degrees and decimal minutes: 10º41.22' as Angle in degrees, minutes and decimal seconds: 10º41'13.20" c Currency, using the language setting:   \$123,456.79 d Decimal integer: 123457 e Exponential with lower case e, using the language setting for decimal point: 1.234568e+05 E Exponential with upper case E, using the language setting for decimal point: 1.234568E+05 f Fractional, with two decimal digits if Digits not specified: 123456.79 n fractional using digit groups, with two decimal digits if Digits not specified: 123,456.79 x hexadecimal integer using lower case letters: 1e241 X hexadecimal integer using upper case letters: 1E241

Default settings in a table showing a variety of fields.  The Longitude and Latitude fields are float64 numbers:

The ad, am, and as options for numeric fields are formats specially designed for numbers that represent angular measurements, like latitudes and longitudes.

For example, right-clicking on the Longitude column head and choosing Style, we can choose the ad option, using a Digits number of 3 for three digits after the decimal point.

Longitudes and latitudes almost always in GIS are shown as positive and negative numbers, following the convention that positive longitude numbers are East longitudes, that is, to the East of the Prime Meridian, and negative longitude numbers are West longitudes, that is, to the West of the Prime Meridian.    Likewise, positive latitude numbers are North latitudes, to the North of the Equator and negative latitude numbers are South latitudes, to the South of the Equator.

Another common way of representing East or West longitudes and North or South latitudes is, instead of using positive or negative numbers, to append a letter like N, E, S, or W to indicate East and West longitudes or North or South latitudes.   The Positive degrees option in the Style dialog allows us to specify which hemisphere uses positive numbers.   In the example above, where we are specifying the display style for numbers in the Longitude column, we have chosen E in the Positive degrees box.  That tells the system to append an E to positive numbers to indicate they are East longitudes, and to append a W to negative numbers to indicate they are West longitudes:

The table instantly shows positive numbers in the Longitude column with three digits after the decimal point, followed by a degree symbol and a capital E character.   Negative numbers in the Longitude column are shown with a capital W character.

We can right-click onto the Latitude column head and choose Style to specify an analogous style for the latitude numbers:

We choose ad as the style option, 3 as the number of Digits, and N for the Positive degrees hemisphere, meaning, to append an N character for positive latitude values and appending an S character for negative latitude values:

Note that specifying display styles that use letters and symbols like the degree symbol does not change the numeric data type of the Longitude and Latitude fields into a text data type. Likewise, choosing the number of Digits to display past the decimal point does not round the numbers to only three digits after the decimal point.   All we change is how the numbers are displayed in the table, but not the numbers themselves or their data type.

The other options in the Style dialog, besides the ad, am, and as options intended for latitude and longitude fields, are styles that can be used with numeric values.   Examples of their use follow below:

Using neutral language for all fields.  Using c currency setting for the Float64 Field, E exponential setting for Integer Field, and am degrees with decimal minutes setting for the Longitude and Latitude fields:

Using German language as used in Germany (de-DE) language for all fields.  Using c currency setting for the Float64 Field, E exponential setting for Integer Field, and as degrees, minutes and decimal seconds setting for the Longitude and Latitude fields, with E being the Positive degrees setting for Longitude and N being the Positive degrees setting for Latitude:

Note how the use of German language as used in Germany (de-DE) not only switched the digit group separator from a comma , character to a dot . character in the Float64 Field, it also changed the decimal point character from a dot . character to a comma , character in all fields, and it switched the currency symbol from a dollar sign to a euro sign, moving the currency symbol to the end of the displayed value.

## Numeric Vector Styles

Numeric vector values are formatted using the same styles as numeric values, with a variation for ad, am, and as angle styles that are intended to support the frequent use of numeric vectors to represent longitude and latitude values in a two component vector, or to represent longitude, latitude, and Z values in a three component vector.

When using ad, am, and as angle styles together with a Positive degrees hemisphere designation, the hemisphere letter will alternate between the two vector components, between N and E or between S and W as follows:

• If the Positive degrees  option is specified and it is specified as E,  the first vector component is formatted as E and the second component as N.  This corresponds to typical X,Y vector longitude, latitude ordering and the convention that eastern hemisphere longitudes and northern hemisphere latitudes are positive.
• When N is specified in the Positive degrees option, the first vector component is formatted as N and the second component as E. That corresponds to "backwards" Y,X vector latitude, longitude ordering while retaining the convention that eastern hemisphere longitudes and northern hemisphere latitudes are positive.   This is a handy option for dealing with numeric vectors created by people who have not read the That YX Thing essay.
• When W is specified in the Positive degrees option, the first vector component is formatted as W and the second component as S.  This corresponds to typical X,Y vector longitude, latitude ordering but using a backwards arrangement from the usual convention by representing eastern hemisphere longitudes and northern hemisphere latitudes as negative, with western hemisphere longitudes and southern hemisphere latitudes as positive.
• When S is specified in the Positive degrees option, the first vector component is formatted as S and the second component as W.  This corresponds to a double backwards arrangement of Y,X vector latitude, longitude ordering while using positive numbers for western hemisphere longitudes and southern hemisphere latitudes.
• When lower case Positive degrees options are specified, then lower case n, e, s, and w letters are used in the displayed format.
• If there are three components in the vector, the third component is formatted as a plain floating-point number, not using angle style.  That is a typical arrangement for a three component vector showing longitude, latitude, and a Z (height) or other numeric value.
• If there are four components in the vector, the third value is formatted the same as the first value,  and the fourth value is formatted the same as the second value.  That is a typical arrangement for a vector of four values that represent two point locations, such as the beginning and end of a straight line segment.

 (default) Fractional with all decimal digits by default: 123456.7890123 ad Angle in decimal degrees: 10.69º   Specifying a positive hemisphere will alternate N/E and S/W tags in the first two vector components. am Angle in degrees and decimal minutes: 10º41.22'   Specifying a positive hemisphere will alternate N/E and S/W tags in the first two vector components. as Angle in degrees, minutes and decimal seconds: 10º41'13.20"   Specifying a positive hemisphere will alternate N/E and S/W tags in the first two vector components. c Currency, using the language setting:   \$123,456.79 d Decimal integer: 123457 e Exponential with lower case e, using the language setting for decimal point: 1.234568e+05 E Exponential with upper case E, using the language setting for decimal point: 1.234568E+05 f Fractional, with two decimal digits if Digits not specified: 123456.79 n fractional using digit groups, with two decimal digits if Digits not specified: 123,456.79 x hexadecimal integer using lower case letters: 1e241 X hexadecimal integer using upper case letters: 1E241

When specifying a Positive degrees option, the use of alternating N/E or S/W characters can be easily seen in previews in the Style dialog:

Consider the table above, which has a two component numeric vector field called x2 float vector.   If we right-click on the column head for that field and choose Style we launch the style dialog for that field:

With no option chosen in the Positive degrees box, both components of the vector will be formatted using angle styles with no use of N, E, S, or W designations.

If we choose E for the Positive degrees hemisphere option, the preview in the Style dialog shows angle styles like ad will use E to indicate positive numbers for the first component and N to indicate positive numbers in the second component.   That is the usual arrangement when the first value in the vector represents a longitude and the second value represents a latitude.

If we are dealing with backwards, YX coordinate ordering in the vector, so that the first value represents latitudes and the second value represents longitudes, we can choose N for the Positive degrees hemisphere option.    In that case the preview in the Style dialog shows angle styles like ad will use N to indicate positive numbers for the first component and E to indicate positive numbers in the second component.

Choosing W or S in the Positive degrees box covers the other two combinations of conventional XY ordering and backwards positive hemisphere choice, or double backwards use of backwards YX ordering with  backwards positive hemisphere choice.   Those are very unusual situations but, as they say, "there is one in every crowd," so Manifold provides means to deal with such situations.

Choosing the ad option with the conventional E choice for Positive degrees results in a useful display for conventional ordering of longitude and latitude values within a numeric vector:

Choosing a style to format a three component vector, like the x3 uint vector field in the table above, is just like formatting a two component vector except that the third value is always displayed as a floating point number when a hemisphere choice is made in the Positive degrees box.

For example, if we right-click  the x3 uint vector field and choose Style we get a default preview of options in the Style dialog:

All three components of the numeric vector will be formatted the same way in each of the styles.

However, if we make a choice in the Positive degrees box, such as E, the ad, am, and as angle styles will format the first two values using E and N letters respectively to indicate positive values, while displaying the third value as a floating point number.

We press OK to apply that style, to see how it looks in the table:

The result is a typical display for a three component vector where the first two values are longitude and latitude values, with the third value being some numeric value associated with that location, such as a Z value for heights, or a temperature or some other number.

## See Also

Styling Table Fields

Style: Binary, Boolean, UUID Fields

Style: Datetime Fields

Style: Geom, Tile Fields

Style: Text Fields

Styling Choices in Tables