import math


def round_to_n_significant_digits(value, n_digits):
    """Round to n significant digits.

    Rounds a number to n significant digits, e.g. for 1234 the result
    with 2 significant digits would be 1200.

    Args:
        value (float/int): the value to be rounded
        n_digits (int): the desired number of significant digits

    Returns:
        float: the value rounded to the desired number of significant digits
    """
    if not isinstance(value, (float, int)):
        raise TypeError("Value must be int or float")
    if not isinstance(n_digits, int):
        raise TypeError("Number of digits must be int")
    if not n_digits > 0:
        raise ValueError("Number of digits must be greater than zero")

    return round(value, n_digits - 1 - int(math.floor(math.log10(abs(value)))))