mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-08-08 06:32:18 -04:00
Remove deprecated method from Formatter
This commit is contained in:
parent
87d89f2dc6
commit
026a3e4b93
2 changed files with 17 additions and 24 deletions
|
@ -61,6 +61,8 @@ import de.jensd.fx.fontawesome.AwesomeIcon;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import static com.google.common.base.Preconditions.*;
|
||||||
|
|
||||||
// TODO Arbitration is very basic yet
|
// TODO Arbitration is very basic yet
|
||||||
public class ArbitratorRegistrationViewCB extends CachedViewCB {
|
public class ArbitratorRegistrationViewCB extends CachedViewCB {
|
||||||
private static final Logger log = LoggerFactory.getLogger(ArbitratorRegistrationViewCB.class);
|
private static final Logger log = LoggerFactory.getLogger(ArbitratorRegistrationViewCB.class);
|
||||||
|
@ -441,11 +443,11 @@ public class ArbitratorRegistrationViewCB extends CachedViewCB {
|
||||||
String messagePubKeyAsHex = DSAKeyUtil.getHexStringFromPublicKey(user.getMessagePublicKey());
|
String messagePubKeyAsHex = DSAKeyUtil.getHexStringFromPublicKey(user.getMessagePublicKey());
|
||||||
String name = nameTextField.getText();
|
String name = nameTextField.getText();
|
||||||
|
|
||||||
double maxTradeVolume = formatter.parseToDouble(maxTradeVolumeTextField.getText());
|
double maxTradeVolume = parseToDouble(maxTradeVolumeTextField.getText());
|
||||||
double passiveServiceFee = formatter.parseToDouble(passiveServiceFeeTextField.getText());
|
double passiveServiceFee = parseToDouble(passiveServiceFeeTextField.getText());
|
||||||
double minPassiveServiceFee = formatter.parseToDouble(minPassiveServiceFeeTextField.getText());
|
double minPassiveServiceFee = parseToDouble(minPassiveServiceFeeTextField.getText());
|
||||||
double arbitrationFee = formatter.parseToDouble(arbitrationFeeTextField.getText());
|
double arbitrationFee = parseToDouble(arbitrationFeeTextField.getText());
|
||||||
double minArbitrationFee = formatter.parseToDouble(minArbitrationFeeTextField.getText());
|
double minArbitrationFee = parseToDouble(minArbitrationFeeTextField.getText());
|
||||||
|
|
||||||
String webUrl = webPageTextField.getText();
|
String webUrl = webPageTextField.getText();
|
||||||
String description = descriptionTextArea.getText();
|
String description = descriptionTextArea.getText();
|
||||||
|
@ -472,6 +474,15 @@ public class ArbitratorRegistrationViewCB extends CachedViewCB {
|
||||||
stage.close();
|
stage.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private double parseToDouble(String input) {
|
||||||
|
try {
|
||||||
|
checkNotNull(input);
|
||||||
|
checkArgument(input.length() > 0);
|
||||||
|
input = input.replace(",", ".").trim();
|
||||||
|
return Double.parseDouble(input);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,8 +44,6 @@ import javax.inject.Inject;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import static com.google.common.base.Preconditions.*;
|
|
||||||
|
|
||||||
//TODO convert to non static
|
//TODO convert to non static
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -245,22 +243,6 @@ public class BSFormatter {
|
||||||
// Other
|
// Other
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
/**
|
|
||||||
* @param input String to be converted to a double. Both decimal points "." and ",
|
|
||||||
* " are supported. Thousands separator is not supported.
|
|
||||||
* @return Returns a double value. Any invalid value returns Double.NEGATIVE_INFINITY.
|
|
||||||
*/
|
|
||||||
@Deprecated //TODO use Fiat or Btc if possible
|
|
||||||
public double parseToDouble(String input) {
|
|
||||||
try {
|
|
||||||
checkNotNull(input);
|
|
||||||
checkArgument(input.length() > 0);
|
|
||||||
input = input.replace(",", ".").trim();
|
|
||||||
return Double.parseDouble(input);
|
|
||||||
} catch (Exception e) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public String formatDirection(Direction direction) {
|
public String formatDirection(Direction direction) {
|
||||||
return formatDirection(direction, true);
|
return formatDirection(direction, true);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue