Skip to content

Commit

Permalink
[models] refs #263 - Format numbers correctly in wallets view model
Browse files Browse the repository at this point in the history
  • Loading branch information
AntiD2ta committed Jan 5, 2020
1 parent b8822b0 commit 492a7c4
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/models/walletsModel.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package models

import (
"strconv"

coin "github.com/fibercrypto/fibercryptowallet/src/coin/skycoin/models"
"github.com/fibercrypto/fibercryptowallet/src/util"
"github.com/fibercrypto/fibercryptowallet/src/util/logging"
"github.com/therecipe/qt/core"
"github.com/therecipe/qt/qml"
Expand Down Expand Up @@ -98,7 +102,12 @@ func (walletModel *WalletModel) data(index *core.QModelIndex, role int) *core.QV

case CoinHours:
{
return core.NewQVariant1(w.CoinHours())
accuracy, err := util.AltcoinQuotient(coin.CoinHoursTicker)
if err != nil {
logWalletsModel.WithError(err).Warn("Couldn't get " + coin.CoinHoursTicker + " coins quotient")
}
val, err := strconv.ParseUint(w.CoinHours(), 10, 64)
return core.NewQVariant1(util.FormatCoins(val, accuracy))
}
case FileName:
{
Expand Down

0 comments on commit 492a7c4

Please sign in to comment.