changed logic of unit count calculation based on internal tool type See merge request fronk/thetool!1426