def get_most_precise(regnskab_tuples):
    """ Returns the 'best' value for a given entry in a financial statement """

    def order_key(t):
        """
        Key for tuple of regnskabsid, fieldname, fieldvalue, decimals,
        precision, startDate, endDate, unitId.
        """
        dec = -1000
        if (t.decimals is not None and len(t.decimals) > 0 and
                t.decimals.lower() != 'inf'):
            dec = float(t.decimals)
        is_dec_inf = False
        if t.decimals is not None and t.decimals.lower() == 'inf':
            is_dec_inf = True

        return (t.startDate, t.endDate, is_dec_inf,
                dec, t.fieldValue)

    regnskab_tuples.sort(key=order_key, reverse=True)
    
    return regnskab_tuples[0].fieldValue