Please enable JavaScript to view this site.

 

Navigation: Tokens > Astronomical Tokens

Astronomical Data Formats

Scroll Prev Up Next More

To format the result of planetary tokens and miscellaneous astronomical tokens, you can append the suffix :fSomeFormat to the token, with the formatting string built from the elements below (note that some astronomical data, such as right ascension and sidereal time, are expressed in hours-minutes-seconds, but these are actually angles, not times).

 

H

Displays the angle hour without a leading zero (0-23)

HH

Displays the angle hour with a leading zero (00-23)

hH

Displays the angle hour with a leading space ( 0-23)

D

Displays the angle degree without a leading zero (-180 to +180)

DD

Displays the angle degree with a leading zero

dD

Displays the angle degree with a leading space

N

Displays the minutes without a leading zero (0-59).

NN

Displays the minutes with a leading zero (00-59).

nN

Displays the minutes with a leading space ( 0-59).

S

Displays the seconds without a leading zero (0-59).

SS

Displays the seconds without a leading zero (0-59).

sS

Displays the seconds with a leading space ( 0-59).

+

A plus sign, at the very beginning of the formatting string, indicates that positive values should be preceded by a + sign.

. or ,

Use a comma or a period, followed by a number from 0 to 3.

Using numbers from 1 to 3 indicates that between 1 and 3 decimals digits should be shown, after a comma or a period, as specified.

Using the digit 0 indicates that the value should be rounded to the nearest integer (with 0 decimals).

""

Use pairs of double-quotes to identify text that should appear as is, such as spaces, or separators, as in the examples dD"°"NN.0"'" and hH"h"NN.0"m".

 

To display double-quotes, for example to display minutes, use 2 consecutive single apostrophes. For example, the format string D"°"NN"'"SS"''" with its double apostrophe (enclosed in double quotes as always) will convert as -23°01'54", for example

 

Note how the character used to format minutes is the letter 'n', and not the letter 'm' which is used elsewhere to format months.

 

Format names

 

To avoid repeating the same lengthy formats in your templates or in the GenTokens options, you can specify a list of format names in the planetary tab of the moon and sun options.

 


Topic 181170, last updated on 26-Feb-2023