<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _colorbar_format(minval, maxval):
 """Return the format string for the colorbar."""

    if not (np.isfinite(minval) and np.isfinite(maxval)):
        return str(maxval)
    else:
        return '%.{}f'.format(_digits(minval, maxval))