mirror of
https://github.com/Qortal/qortal.git
synced 2025-07-23 04:36:50 +00:00
Fix for incorrect amounts reported by API
This commit is contained in:
22
src/test/java/org/qortal/test/AmountsTests.java
Normal file
22
src/test/java/org/qortal/test/AmountsTests.java
Normal file
@@ -0,0 +1,22 @@
|
||||
package org.qortal.test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.qortal.utils.Amounts;
|
||||
|
||||
public class AmountsTests {
|
||||
|
||||
@Test
|
||||
public void testPrettyAmount() {
|
||||
testPrettyAmount(1L, "0.00000001");
|
||||
testPrettyAmount(100000L, "0.00100000");
|
||||
testPrettyAmount(100000000L, "1.00000000");
|
||||
testPrettyAmount(1000000000L, "10.00000000");
|
||||
}
|
||||
|
||||
private void testPrettyAmount(long amount, String prettyAmount) {
|
||||
assertEquals(prettyAmount, Amounts.prettyAmount(amount));
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user