예제 #1
0
파일: model.py 프로젝트: kirillseva/goxgui
    def data(self, index, role):

        if role == Qt.TextAlignmentRole:
            return Qt.AlignRight | Qt.AlignVCenter

        if (not index.isValid()) or (role != Qt.DisplayRole):
            return QVariant()

        row = index.row()
        col = index.column()

        if col == 0:
            return QVariant(money.to_string(
                self.get_price(row), self._get_quote_currency()))
        if col == 1:
            return QVariant(money.to_string(
                self.get_size(row), self._get_base_currency()))
예제 #2
0
파일: model.py 프로젝트: dkgeorge/goxgui
    def data(self, index, role):

        if role == Qt.TextAlignmentRole:
            return Qt.AlignRight | Qt.AlignVCenter

        if (not index.isValid()) or (role != Qt.DisplayRole):
            return QVariant()

        (value, currency) = self.__getters[index.column()](index.row())
        return QVariant(money.to_string(value, currency))
예제 #3
0
 def test_to_string(self):
     self.assertEquals('7,000.00000',
         money.to_string(700000000000, Currency('USD')))