parent
289005c0e6
commit
64d6c484b2
|
@ -29,8 +29,11 @@ QtObject {
|
||||||
|
|
||||||
function numberFromLocaleString(num, locale = null) {
|
function numberFromLocaleString(num, locale = null) {
|
||||||
locale = locale || Qt.locale()
|
locale = locale || Qt.locale()
|
||||||
|
try {
|
||||||
return Number.fromLocaleString(locale, num)
|
return Number.fromLocaleString(locale, num)
|
||||||
|
} catch (_) {
|
||||||
|
return parseFloat(num)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function currencyAmountToLocaleString(currencyAmount, options = null, locale = null) {
|
function currencyAmountToLocaleString(currencyAmount, options = null, locale = null) {
|
||||||
|
|
|
@ -23,14 +23,20 @@ ColumnLayout {
|
||||||
Binding {
|
Binding {
|
||||||
target: root
|
target: root
|
||||||
property: "cryptoValueToSend"
|
property: "cryptoValueToSend"
|
||||||
value: root.selectedAsset, !inputIsFiat ? getCryptoCurrencyAmount(LocaleUtils.numberFromLocaleString(topAmountToSendInput.text)) : getCryptoValue(fiatValueToSend ? fiatValueToSend.amount : 0.0)
|
value: {
|
||||||
|
const value = !inputIsFiat ? getCryptoCurrencyAmount(LocaleUtils.numberFromLocaleString(topAmountToSendInput.text)) : getCryptoValue(fiatValueToSend ? fiatValueToSend.amount : 0.0)
|
||||||
|
return root.selectedAsset, value
|
||||||
|
}
|
||||||
delayed: true
|
delayed: true
|
||||||
}
|
}
|
||||||
property var fiatValueToSend
|
property var fiatValueToSend
|
||||||
Binding {
|
Binding {
|
||||||
target: root
|
target: root
|
||||||
property: "fiatValueToSend"
|
property: "fiatValueToSend"
|
||||||
value: root.selectedAsset, inputIsFiat ? getFiatCurrencyAmount(LocaleUtils.numberFromLocaleString(topAmountToSendInput.text)) : getFiatValue(cryptoValueToSend ? cryptoValueToSend.amount : 0.0)
|
value: {
|
||||||
|
const value = inputIsFiat ? getFiatCurrencyAmount(LocaleUtils.numberFromLocaleString(topAmountToSendInput.text)) : getFiatValue(cryptoValueToSend ? cryptoValueToSend.amount : 0.0)
|
||||||
|
return root.selectedAsset, value
|
||||||
|
}
|
||||||
delayed: true
|
delayed: true
|
||||||
}
|
}
|
||||||
property string currentCurrency
|
property string currentCurrency
|
||||||
|
|
Loading…
Reference in New Issue