Fixed double parsing for exchange

pull/2/head
Michael Scoff 7 years ago
parent d259f0e101
commit f2d0c68952
  1. 10
      Trust/Transactions/ViewModels/BalanceViewModel.swift

@ -30,8 +30,8 @@ struct BalanceViewModel {
} }
var amount: Double { var amount: Double {
guard let balance = balance, let amount = Double(balance.amount) else { return 0.00 } guard let balance = balance else { return 0.00 }
return amount return balance.amount.doubleValue
} }
var amountString: String { var amountString: String {
@ -75,16 +75,22 @@ struct BalanceViewModel {
} }
var largeLabelAttributed: [String: AnyObject] { var largeLabelAttributed: [String: AnyObject] {
let style = NSMutableParagraphStyle()
style.alignment = NSTextAlignment.center
return [ return [
NSFontAttributeName: UIFont.systemFont(ofSize: 18, weight: UIFontWeightSemibold), NSFontAttributeName: UIFont.systemFont(ofSize: 18, weight: UIFontWeightSemibold),
NSForegroundColorAttributeName: Colors.lightBlack, NSForegroundColorAttributeName: Colors.lightBlack,
NSParagraphStyleAttributeName: style,
] ]
} }
var smallLabelAttributes: [String: AnyObject] { var smallLabelAttributes: [String: AnyObject] {
let style = NSMutableParagraphStyle()
style.alignment = NSTextAlignment.center
return [ return [
NSFontAttributeName: UIFont.systemFont(ofSize: 13, weight: UIFontWeightRegular), NSFontAttributeName: UIFont.systemFont(ofSize: 13, weight: UIFontWeightRegular),
NSForegroundColorAttributeName: Colors.darkGray, NSForegroundColorAttributeName: Colors.darkGray,
NSParagraphStyleAttributeName: style,
] ]
} }
} }

Loading…
Cancel
Save