mirror of
https://github.com/boldsuck/haveno.git
synced 2025-01-03 14:49:25 +00:00
fix decimal formatting to US convention (no commas) in offer book
This commit is contained in:
parent
9dd53cb892
commit
d65f36f122
2 changed files with 2 additions and 2 deletions
|
@ -63,7 +63,7 @@ import org.bitcoinj.core.Coin;
|
||||||
public class HavenoUtils {
|
public class HavenoUtils {
|
||||||
|
|
||||||
// Use the US locale as a base for all DecimalFormats (commas should be omitted from number strings).
|
// Use the US locale as a base for all DecimalFormats (commas should be omitted from number strings).
|
||||||
private static final DecimalFormatSymbols DECIMAL_FORMAT_SYMBOLS = DecimalFormatSymbols.getInstance(Locale.US);
|
public static final DecimalFormatSymbols DECIMAL_FORMAT_SYMBOLS = DecimalFormatSymbols.getInstance(Locale.US);
|
||||||
public static int XMR_SMALLEST_UNIT_EXPONENT = 12;
|
public static int XMR_SMALLEST_UNIT_EXPONENT = 12;
|
||||||
public static final String LOOPBACK_HOST = "127.0.0.1"; // local loopback address to host Monero node
|
public static final String LOOPBACK_HOST = "127.0.0.1"; // local loopback address to host Monero node
|
||||||
public static final String LOCALHOST = "localhost";
|
public static final String LOCALHOST = "localhost";
|
||||||
|
|
|
@ -65,7 +65,7 @@ public class VolumeUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Volume getRoundedVolumePrecise(Volume volumeByAmount) {
|
public static Volume getRoundedVolumePrecise(Volume volumeByAmount) {
|
||||||
DecimalFormat decimalFormat = new DecimalFormat("#.####");
|
DecimalFormat decimalFormat = new DecimalFormat("#.####", HavenoUtils.DECIMAL_FORMAT_SYMBOLS);
|
||||||
double roundedVolume = Double.parseDouble(decimalFormat.format(Double.parseDouble(volumeByAmount.toString())));
|
double roundedVolume = Double.parseDouble(decimalFormat.format(Double.parseDouble(volumeByAmount.toString())));
|
||||||
return Volume.parse(String.valueOf(roundedVolume), volumeByAmount.getCurrencyCode());
|
return Volume.parse(String.valueOf(roundedVolume), volumeByAmount.getCurrencyCode());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue