def _fix_floating_point(a):
    """Iterate through an array of dicts, checking for floats and rounding them."""

    def get_type(thing):
        try:
            return thing['type']
        except KeyError:
            return 'message'

    for thing in a:
        if get_type(thing) not in ['cbg', 'smbg']:
            for key, val in thing.items():
                if isinstance(val, float):
                    thing[key] = round(val, 3)

    return a