jyotisha/custom_transliteration.py
def sexastr2deci(sexa_str):
    """Converts as sexagesimal string to decimal

    Converts a given sexagesimal string to its decimal value

    Args:
      A string encoding of a sexagesimal value, with the various
      components separated by colons

    Returns:
      A decimal value corresponding to the sexagesimal string

    Examples:
      >>> sexastr2deci('15:30:00')
      15.5
      >>> sexastr2deci('-15:30:45')
      -15.5125
    """

    if sexa_str[0] == '-':
        sgn = -1.0
        dms = sexa_str[1:].split(':')  # dms = degree minute second
    else:
        sgn = 1.0
        dms = sexa_str.split(':')

    decival = 0
    for i in range(0, len(dms)):
        decival = decival + float(dms[i]) / (60.0 ** i)

    return decival * sgn
Converts as sexagesimal string to decimal

    Converts a given sexagesimal string to its decimal value

    Args:
      A string encoding of a sexagesimal value, with the various
      components separated by colons

    Returns:
      A decimal value corresponding to the sexagesimal string

    Examples:
      >>> sexastr2deci('15:30:00')
      15.5
      >>> sexastr2deci('-15:30:45')
      -15.5125
    
Converts as sexagesimal string to decimal
Converts a given sexagesimal string to its decimal value

A string encoding of a sexagesimal value, with the various
components separated by colons

A decimal value corresponding to the sexagesimal string


Converts as sexagesimal string to decimal Converts a given sexagesimal string to its decimal value A string encoding of a sexagesimal value with the various components separated by colons A decimal value corresponding to the sexagesimal string
def sexastr2deci(sexa_str):
    if sexa_str[0] == '-':
        sgn = -1.0
        dms = sexa_str[1:].split(':')  
    else:
        sgn = 1.0
        dms = sexa_str.split(':')
    decival = 0
    for i in range(0, len(dms)):
        decival = decival + float(dms[i]) / (60.0 ** i)
    return decival * sgn
def sexastr2deci ( sexa_str ) : if sexa_str [ 0 ] == '-' : sgn = - 1.0 dms = sexa_str [ 1 : ] . split ( ':' ) else : sgn = 1.0 dms = sexa_str . split ( ':' ) decival = 0 for i in range ( 0 , len ( dms ) ) : decival = decival + float ( dms [ i ] ) / ( 60.0 ** i ) return decival * sgn
Converts as sexagesimal string to decimal
Converts a given sexagesimal string to its decimal value
Converts as sexagesimal string to decimal Converts a given sexagesimal string to its decimal value
"""Converts as sexagesimal string to decimal

    Converts a given sexagesimal string to its decimal value

    Args:
      A string encoding of a sexagesimal value, with the various
      components separated by colons

    Returns:
      A decimal value corresponding to the sexagesimal string

    Examples:
      >>> sexastr2deci('15:30:00')
      15.5
      >>> sexastr2deci('-15:30:45')
      -15.5125
    """ # dms = degree minute second
sexa_str