def translation_percent(translated, total):
 if ((total == 0) or (total is None)):
  return 0.0
 perc = (round(((1000 * translated) / total)) / 10.0)
 if ((perc == 0.0) and (translated != 0)):
  return 0.1
 if ((perc == 100.0) and (translated != total)):
  return 99.9
 return perc

def translation_percent ( translated , total ) : if ( ( total == 0 ) or ( total is None ) ) : return 0.0 perc = ( round ( ( ( 1000 * translated ) / total ) ) / 10.0 ) if ( ( perc == 0.0 ) and ( translated != 0 ) ) : return 0.1 if ( ( perc == 100.0 ) and ( translated != total ) ) : return 99.9 return perc
returns translation percentage .