Skip to content

Commit

Permalink
fixed float format
Browse files Browse the repository at this point in the history
  • Loading branch information
metaclips committed Dec 31, 2019
1 parent f7b47c5 commit 2a77002
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions fyne/pages/handler/walletshandler/walletselector.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ import (
"fmt"
"strconv"

"fyne.io/fyne/theme"

"fyne.io/fyne"
"fyne.io/fyne/canvas"
"fyne.io/fyne/layout"
"fyne.io/fyne/theme"
"fyne.io/fyne/widget"

"github.com/raedahgroup/dcrlibwallet"
Expand Down Expand Up @@ -49,7 +48,7 @@ func (walletPage *WalletPageObject) getAccountsInWallet(index, selectedWalletID
for _, acc := range accts.Acc {
totalBalance += acc.TotalBalance
}
balanceInString := strconv.FormatFloat(dcrlibwallet.AmountCoin(totalBalance), 'f', 8, 64)
balanceInString := strconv.FormatFloat(dcrlibwallet.AmountCoin(totalBalance), 'f', -1, 64)

walletPage.WalletTotalAmountLabel[index].Text = fmt.Sprintf(values.AmountInDCR, balanceInString)

Expand Down Expand Up @@ -180,8 +179,8 @@ func (walletPage *WalletPageObject) walletAccountBox(walletBoxSize int, account
canvas.NewText("Spendable", values.SpendableLabelColor),
layout.NewSpacer())

totalBalanceInString := strconv.FormatFloat(dcrlibwallet.AmountCoin(account.TotalBalance), 'f', 8, 64)
spendableBalanceInString := strconv.FormatFloat(dcrlibwallet.AmountCoin(account.Balance.Spendable), 'f', 8, 64)
totalBalanceInString := strconv.FormatFloat(dcrlibwallet.AmountCoin(account.TotalBalance), 'f', -1, 64)
spendableBalanceInString := strconv.FormatFloat(dcrlibwallet.AmountCoin(account.Balance.Spendable), 'f', -1, 64)

accountBalAndSpendableBal := widgets.NewVBox(
layout.NewSpacer(),
Expand Down

0 comments on commit 2a77002

Please sign in to comment.