code: def percentage(value, digits=2):
      '''
      Converts a fraction to a formatted percentage.
  
      :param value: number
      :param digits: default ``2``
  
      >>> print(percentage(1))
      100.00 %
      >>> print(percentage(0.23, digits=0))
      23 %
      >>> print(percentage(23.421))
      2,342.10 %
  
      '''
  
      value = float(value) * 100.0
      return u'' + '%s %%' % (_format(value, digits),f percentage(value, digits=2):
      '''
      Converts a fraction to a formatted percentage.
  
      :param value: number
      :param digits: default ``2``
  
      >>> print(percentage(1))
      100.00 %
      >>> print(percentage(0.23, digits=0))
      23 %
      >>> print(percentage(23.421))
      2,342.10 %
  
      '''
  
      value = float(value) * 100.0
      return u'' + '%s %%' % (_format(value, digits),)
docs: Converts a fraction to a formatted percentage.
  
      :param value: number
      :param digits: default ``2``
  
      >>> print(percentage(1))
      100.00 %
      >>> print(percentage(0.23, digits=0))
      23 %
      >>> print(percentage(23.421))
      2,342.10 %