模板:Deg2DMS
0° 0' 0''
此模板被引用于约3,000个页面。 为了避免造成大规模的影响,所有对此模板的编辑应先于沙盒、测试样例或您的沙盒上测试。 测试后无误的版本可以一次性地加入此模板中,但是修改前请务必于讨论页发起讨论。 模板引用数量会自动更新。 |
Description
This template converts a positive decimal degree value to degrees° minutes' seconds'' format or to degrees° minutesm secondss format (the degree symbol °
is invariant between the two formats).
Usage
{{Deg2DMS|positive decimal degrees|p=precision|sup=ms}}
.
Parameter p is optional and defaults to 3. It is the number of decimal digits that the seconds are rounded to.
Parameter sup is optional and changes the default apostrophe-format for arcminutes and arcseconds (1° 2' 3'') to the m-s-format for arcminutes and arcseconds (1° 2m 3s). Any non-blank value has this effect, but using |sup=ms
is customary.
For example:
{{Deg2DMS|266.416837}}
returns 266° 25' 0.613''.
{{Deg2DMS|266.416837|p=4}}
returns 266° 25' 0.6132''.
{{Deg2DMS|266.416837|p=4|sup= }}
returns 266° 25' 0.6132''.
{{Deg2DMS|266.416837|p=4|sup=ms}}
returns 266° 25m 0.6132s.
{{Deg2DMS|266.416837|p=4|sup=no}}
returns 266° 25m 0.6132s.
{{Deg2DMS|266.416837|p=4|sup=''}}
returns 266° 25m 0.6132s.