mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 01:41:11 +01:00
Make formatSatoshis visible for testing
This commit is contained in:
parent
a3631a022f
commit
f1db254073
@ -17,6 +17,8 @@
|
||||
|
||||
package bisq.cli;
|
||||
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.NumberFormat;
|
||||
|
||||
@ -27,15 +29,17 @@ import java.util.Locale;
|
||||
|
||||
import static java.lang.String.format;
|
||||
|
||||
class CurrencyFormat {
|
||||
@VisibleForTesting
|
||||
public class CurrencyFormat {
|
||||
|
||||
private static final NumberFormat NUMBER_FORMAT = NumberFormat.getInstance(Locale.US);
|
||||
|
||||
static final BigDecimal SATOSHI_DIVISOR = new BigDecimal(100000000);
|
||||
static final DecimalFormat BTC_FORMAT = new DecimalFormat("###,##0.00000000");
|
||||
|
||||
@VisibleForTesting
|
||||
@SuppressWarnings("BigDecimalMethodWithoutRoundingCalled")
|
||||
static String formatSatoshis(long sats) {
|
||||
public static String formatSatoshis(long sats) {
|
||||
return BTC_FORMAT.format(BigDecimal.valueOf(sats).divide(SATOSHI_DIVISOR));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user