Exemplo n.º 1
0
def format_angle(value, format_type):
    if format_type == "time":
        h, m, s = ratohms(value)
        result = "%d:%d:%.1f" % (h, m, s)
    if format_type == "dms":
        d, m, s = dectodms(value)
        if d > 0:
            sign = '+'
        else:
            sign = '-'
        result = "%s%d:%d:%.1f" % (sign, d, m, s)
    return mark_safe(result)
Exemplo n.º 2
0
def format_angle(value, format_type):
    if format_type == "time":
        h, m, s = ratohms(value)
        result = "%d:%d:%.1f" % (h, m, s)
    if format_type == "dms":
        d, m, s = dectodms(value)
        if d > 0:
            sign = '+'
        else:
            sign = '-'
        result = "%s%d:%d:%.1f" % (sign, d, m, s)
    return mark_safe(result)
Exemplo n.º 3
0
 def testknownValues(self):
     for input, output in self.knownValues:
         result = coordinates.ratohms(input)
         self.assertEqual(result, output)