accounting/accounting.py
def to_fixed(self, value, precision):
        """Implementation that treats floats more like decimals.

        Fixes binary rounding issues (eg. (0.615).toFixed(2) === "0.61")
        that present problems for accounting and finance-related software.

        """
        precision = self._change_precision(
            precision, self.settings['number']['precision'])

        power = pow(10, precision)
        # Multiply up by precision, round accurately, then divide
        power = round(self.parse(value) * power) / power
        return '{0} {1}.{2}f'.format(value, precision, precision)
Implementation that treats floats more like decimals.

        Fixes binary rounding issues (eg. (0.615).toFixed(2) === "0.61")
        that present problems for accounting and finance-related software.

        
Implementation that treats floats more like decimals.
Fixes binary rounding issues .toFixed(2) === "0.61")
that present problems for accounting and finance-related software.
Implementation that treats floats more like decimals . Fixes binary rounding issues . toFixed ( 2 ) === " 0 . 61 " ) that present problems for accounting and finance - related software .
def to_fixed(self, value, precision):
        precision = self._change_precision(
            precision, self.settings['number']['precision'])
        power = pow(10, precision)
        power = round(self.parse(value) * power) / power
        return '{0} {1}.{2}f'.format(value, precision, precision)
def to_fixed ( self , value , precision ) : precision = self . _change_precision ( precision , self . settings [ 'number' ] [ 'precision' ] ) power = pow ( 10 , precision ) power = round ( self . parse ( value ) * power ) / power return '{0} {1}.{2}f' . format ( value , precision , precision )
Implementation that treats floats more like decimals.
Implementation that treats floats more like decimals .
"""Implementation that treats floats more like decimals.

        Fixes binary rounding issues (eg. (0.615).toFixed(2) === "0.61")
        that present problems for accounting and finance-related software.

        """ # Multiply up by precision, round accurately, then divide
self
value
precision