def _as_percentage_of(cost_micropennies, total_cost_micropennies):
 if (total_cost_micropennies == 0):
  return 0
 return round(((float(cost_micropennies) / float(total_cost_micropennies)) * 100), 1)

def _as_percentage_of ( cost_micropennies , total_cost_micropennies ) : if ( total_cost_micropennies == 0 ) : return 0 return round ( ( ( float ( cost_micropennies ) / float ( total_cost_micropennies ) ) * 100 ) , 1 )
the cost as a percentage of the total cost .