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
30
31
32
33
34
35
36
| package com.nuvole.poscom.util;
|
| import java.math.BigDecimal;
|
| /**
| * @Description 云打印机工具类
| * @Author ZHAOXL
| * @Date 2024/3/8 16:36
| * @Version 1.0
| */
| public class PoscomUtil {
|
| /**
| * 分转为元
| * @Author ZHAOXL
| * @Date 2024/3/8 16:48
| * @Version 1.0
| */
| public static String convertToYuan(Long payMoney) {
| if (payMoney == null) {
| return "0";
| }
| BigDecimal totalAmount = new BigDecimal("" + payMoney).divide(new BigDecimal("100"));
| return totalAmount + "";
| }
|
| /**
| * long转String
| * @Author ZHAOXL
| * @Date 2024/3/8 16:39
| * @Version 1.0
| */
| public static String longToString(Long param) {
| return param == null ? "0" : Long.toString(param);
| }
| }
|
|