.. include:: ../substitutions

.. oe:namespace:: OEChem

.. meta::
   :keywords: OENetCharge

.. oe:function:: OENetCharge

   .. oe:language:: c++ java csharp

      .. oe:api::

         int OENetCharge(const OEMolBase& mol)

   .. oe:language:: python

      .. oe:api:: python

         OENetCharge(mol: Union[OEGraphMol,OEMol,OEQMol]) -> int

   Determines the net charge on a molecule.  If the molecule has
   specified partial charges, see **OEChem TK**'s
   :oe:func:`OEChem::OEHasPartialCharges` function, this function returns
   the sum of the partial charges rounded to an integer.  Otherwise this
   function returns the sum of the formal charges on each atom of the
   molecule.

