from math import floor


def dd2ddm(x):
    """A little helper function that takes a coordinate in decimal
    degrees and splits it into degrees, decimal minutes.  Values are
    returned as a dictionary that can then be used in string
    formatting"""


    negative = 1 if x > 0 else -1

    x = abs(x)
    degrees = floor(x)
    minutes = (x - degrees) * 60
    degrees = degrees * negative

    return {"degrees": degrees, "minutes": minutes}