def numToString(num, numDigits):
    """
        Given a number returns its string format with the specified length, adding '0' if necessary

        @param num: A number (int)
        @param numDigits: Length of the output string (int)
        @return: A tuple (status,statusContent), where statusContent is a number in string format in case status = 0 or an error in case status = -1
    """
    if not isinstance(num, int):
        return -1, 'Bad number'
    strNum = str(num)
    if numDigits < len(strNum):
        return -1, 'Bad digit number'
    for i in range(numDigits - len(strNum)):
        strNum = '0' + strNum
    return 0, strNum
