parameters: (num, decimals, max_num=0)
return_statement: return num_str
docstring: Converts a number to a string. Will add left padding based on the max value to ensure numbers
      align well. Will also add commas to numbers over 1000.
docstring_summary: Converts a number to a string. Will add left padding based on the max value to ensure numbers
      align well. Will also add commas to numbers over 1000.
docstring_tokens: Converts a number to a string . Will add left padding based on the max value to ensure numbers align well . Will also add commas to numbers over 1000 .
function: def float_to_str(num, decimals, max_num=0):
      """
      Converts a number to a string. Will add left padding based on the max value to ensure numbers
      align well. Will also add commas to numbers over 1000.
      """
      if decimals == 0:
          return int_to_str(int(round(num)), max_num=max_num)
      if num is None:
          num_str = 'n/a'
      else:
          num_str = '%.' + str(decimals) + 'f'
          num_str = num_str % num
          parts = num_str.split('.')
          before_decimal = parts[0]
          after_decimal = parts[1]
          num_str = int_to_str(int(before_decimal)) + '.' + after_decimal
      if max_num > 0:
          max_str = float_to_str(max_num, decimals)
          num_str = num_str.rjust(len(max_str))
      return num_str
function_tokens: def float_to_str ( num , decimals , max_num = 0 ) : if decimals == 0 : return int_to_str ( int ( round ( num ) ) , max_num = max_num ) if num is None : num_str = 'n/a' else : num_str = '%.' + str ( decimals ) + 'f' num_str = num_str % num parts = num_str . split ( '.' ) before_decimal = parts [ 0 ] after_decimal = parts [ 1 ] num_str = int_to_str ( int ( before_decimal ) ) + '.' + after_decimal if max_num > 0 : max_str = float_to_str ( max_num , decimals ) num_str = num_str . rjust ( len ( max_str ) ) return num_str