from typing import Union


def get_precision(num: Union[int, float]) -> int:
    """Returns the precision of a number."""
    if type(num) == int:
        return 0
    return len(str(num).split('.')[1])