import math


def round_up(x, digits):
  """Rounds up the |digits| most significant digits.

  For instance: round_up(12345, 2) returns 13000.
  """
  r = 10 ** (len(str(int(x))) - digits)
  return math.ceil(x / r) * r