Adds current value to trace.

def tally(self, chain):
        """Adds current value to trace."""

        try:
            # I changed str(x) to '%f'%x to solve a bug appearing due to
            # locale settings. In french for instance, str prints a comma
            # instead of a colon to indicate the decimal, which confuses
            # the database into thinking that there are more values than there
            # is.  A better solution would be to use another delimiter than the
            # comma. -DH
            valstring = ', '.join(
                ['%f' %
                 x for x in np.ravel(self._getfunc())])
        except:
            valstring = str(self._getfunc())

        # Add value to database
        query = "INSERT INTO [%s] (recid, trace, %s) values (NULL, %s, %s)" % \
            (self.name, self._vstr, chain, valstring)
        self.db.cur.execute(query)