zj
2025-01-06 6e21cf6973aa1898259ddceda665f0f1b06272ab
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package com.yami.trading.common;
 
import com.yami.trading.bean.item.domain.Item;
import com.yami.trading.common.util.Arith;
import org.junit.jupiter.api.Test;
 
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
 
public class ArithTest {
 
    @Test
    public void testAdd() {
        String add = Arith.add("1.111", "2.222");
        assertEquals("3.333", add);
    }
 
    @Test
    public void testAddWithDecimals() {
        String add = Arith.add("1.111", "2.222", 2);
        assertEquals("3.33", add);
    }
 
    @Test
    public void testStr() {
        String add = Arith.str(new Double("1.89234"),3 );
        assertEquals("1.892", add);
    }
}