mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-03-15 10:26:37 -04:00
fix bug with formatting
This commit is contained in:
parent
ab6ae89c38
commit
56ca79a58f
@ -70,7 +70,6 @@ public class ValidatingTextField extends TextField {
|
||||
|
||||
public ValidatingTextField() {
|
||||
super();
|
||||
|
||||
setupListeners();
|
||||
}
|
||||
|
||||
|
@ -203,21 +203,18 @@ class CreateOfferPresenter {
|
||||
// bindBidirectional for amount, price, volume and minAmount
|
||||
amount.addListener(ov -> {
|
||||
model.amountAsCoin = parseToBtcWith4Decimals(amount.get());
|
||||
calculateVolume();
|
||||
calculateTotalToPay();
|
||||
calculateCollateral();
|
||||
});
|
||||
|
||||
price.addListener(ov -> {
|
||||
model.priceAsFiat = parseToFiatWith2Decimals(price.get());
|
||||
calculateVolume();
|
||||
calculateTotalToPay();
|
||||
calculateCollateral();
|
||||
});
|
||||
|
||||
volume.addListener(ov -> {
|
||||
model.volumeAsFiat = parseToFiatWith2Decimals(volume.get());
|
||||
calculateAmount();
|
||||
calculateTotalToPay();
|
||||
calculateCollateral();
|
||||
});
|
||||
@ -259,6 +256,7 @@ class CreateOfferPresenter {
|
||||
showWarningInvalidFiatDecimalPlaces.set(!hasFiatValidDecimals(price.get()));
|
||||
model.priceAsFiat = parseToFiatWith2Decimals(price.get());
|
||||
price.set(formatFiat(model.priceAsFiat));
|
||||
calculateVolume();
|
||||
}
|
||||
}
|
||||
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 80 KiB |
@ -52,7 +52,6 @@ public class BSFormatterTest {
|
||||
assertFalse(hasBtcValidDecimals("0.0001222312312312313"));
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testParseToFiatWith2Decimals() {
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user