• Home
  • Random
  • Nearby
  • Log in
  • Settings
Donate Now If Wikipedia is useful to you, please give today.
  • About Wikipedia
  • Disclaimers
Wikipedia

Template:Decdeg

  • Template
  • Talk
  • Language
  • Watch
  • View source
(Redirected from Template:DMS2Deg)
Template documentation[view] [edit] [history] [purge]


About

This helper template provides a way to convert geographic coordinates from degree, minute, second format to decimal degrees. It is intended for use in building infobox templates.

Usage

The template can be used with named or unnamed parameters as shown.

Parameter Description
{{decdeg
| deg = 
| min =
| sec = 
| hem = 
| rnd =
}}
 
Degrees
Minutes
Seconds
Hemisphere
Round
 

Input degrees can be signed in which case the hemisphere is not required. A negative value implies a value in the western or southern hemisphere. Minutes and seconds need not be specified. If no degrees are specified then a value of zero is assumed. This template does not attempt to trap invalid values and results in this case might be undefined.

The decimal precision of the result is determined by the value assigned rnd, which defaults to 7.

Currently this template does not attempt to trap invalid values.

Examples

{{decdeg|deg=37|min=51|sec=00|hem=N}} → 37.85
{{decdeg|deg=119|min=34|sec=04|hem=W}} → -119.5677778

When using unnamed parameters, the hemisphere must be the fourth parameter:

{{decdeg|37|51||N}} → 37.85
{{decdeg|119|34||W}} → -119.5666667

Input can be signed or unsigned decimal degrees:

{{decdeg|37.85|||N}} → 37.85
{{decdeg|119.5666667|||W}} → -119.5666667
{{decdeg|37.85}} → 37.85
{{decdeg|-119.5666667}} → -119.5666667

When using rounding, the factor must be the fifth parameter:

{{decdeg|37.85||||1}} → 37.9
{{decdeg|-119.5666667||||1}} → -119.6

If a value is undefined then zero is assumed:

{{decdeg||51||N}} → 0.85
{{decdeg||34||W}} → -0.5666667

Negative zero values are accommodated:

{{decdeg|0|51}} → 0.85
{{decdeg|-0|34}} → -0.5666667

See also

  • Template:Coord
  • v
  • t
  • e
Math templates
  • Functions
  • Numeral systems
Functions
  • elementary arithmetic
  • precision
  • val (value formatting)
  • percentage
Numeral systems
  • {{#invoke:BaseConvert|XtoY}}
  • binary
  • decimal2Base
  • hex2dec
  • hexadecimal
  • octal
  • quaternary
  • rn
  • roman
  • ternary
  • vigesimal
Conversions
convert many units (see: list)
cvt abbreviated {{convert}}
convinfobox {{convert}} for infoboxes
bbl to t barrels of oil to tonnes
long ton long hundredweights, quarters and pounds to kilograms;
long tons and hundredweights to pounds and metric tons
miles-chains miles and chains to kilometres linking "chains"
decdeg degrees, minutes, and seconds to decimal degrees
deg2dms decimal degrees to degrees, minutes, and seconds
deg2hms decimal degrees to hour angle (in hours, minutes, and seconds)
hms2deg hour angle (in hours, minutes, and seconds) to decimal degrees
inflation calculate inflation of Consumer Price Index-related prices
pop density population density in an area
track gauge railway track gauges
Notation and formatting
bigmath bigger font to match TeX \displaystyle (standalone formulas only) math short text-based formulas
mathcal [mathematical] calligraphic font; alternative to LaTeX \mathcal{...} tombstone symbol indicating the end of a proof
mvar individual italicized maths variables in normal text val measurement values, uncertainties and units
  • overline
  • underline
a line set above/below a sequence of characters vec various overarrows, underarrows, etc.
abs absolute values (paired vertical lines)
  • langle
  • rangle
  • angbr
  • angular brackets
  • bra-ket
  • braket
  • bra
  • ket
  • bra–ket notation
  • ldelim
  • rdelim
  • multiline delimiters (2–5 lines inclusive)
    ceil, floor calculations :mw:Help:#expr; formatting indicators ⌈3.14⌉, ⌊3.14⌋ (no calculation performed) pars parentheses that can be resized (∑)
    fraction slant fractions 3⁄5 (not for maths/science articles; use standing or upright fractions {{sfrac}} instead) sfrac "standing" or upright fractions ⁠3/5⁠ (use in maths/science articles instead of{{fraction}})
    intmath integral symbols
  • sub
  • sup
  • su
  • subscripts and superscripts
  • overset
  • underset
  • arbitrary characters/diacritics set above/below one another    
    tmath Wrap TeX in <math> tags
  • Boxes
  • Tags
  • Notices
  • BoxesTags
    • arithmetic operations
    • calculus
    • Infobox mathematical function
    • functions
    • metricate
    • undue precision
    • units attention
    • Category
    • Module:Math
    The above documentation is transcluded from Template:Decdeg/doc. (edit | history)
    Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.
    Add categories to the /doc subpage. Subpages of this template.
    Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:Decdeg&oldid=738765748"
    Last edited on 10 September 2016, at 23:11

    Languages

      • Afrikaans
      • العربية
      • অসমীয়া
      • Basa Bali
      • বাংলা
      • Dansk
      • فارسی
      • Føroyskt
      • 한국어
      • Hrvatski
      • Ilokano
      • Bahasa Indonesia
      • Italiano
      • Jawa
      • Latviešu
      • Ligure
      • मैथिली
      • مصرى
      • မြန်မာဘာသာ
      • 日本語
      • ଓଡ଼ିଆ
      • ਪੰਜਾਬੀ
      • ភាសាខ្មែរ
      • Română
      • Scots
      • Simple English
      • Slovenščina
      • کوردی
      • Српски / srpski
      • தமிழ்
      • తెలుగు
      • ไทย
      • اردو
      • Vèneto
      • Tiếng Việt
      • Yorùbá
      • 粵語
      • 中文
      Wikipedia
      • Wikimedia Foundation
      • Powered by MediaWiki
      • This page was last edited on 10 September 2016, at 23:11 (UTC).
      • Content is available under CC BY-SA 4.0 unless otherwise noted.
      • Privacy policy
      • About Wikipedia
      • Disclaimers
      • Contact Wikipedia
      • Code of Conduct
      • Developers
      • Statistics
      • Cookie statement
      • Terms of Use
      • Desktop