mirror of
https://gitee.com/jzsw-it/yexuejc-base.git
synced 2025-06-07 06:14:04 +08:00
1.3.3
This commit is contained in:
parent
93488c6fff
commit
a639d61624
@ -1,6 +1,12 @@
|
||||
yexuejc-base 更新记录
|
||||
------------------
|
||||
|
||||
#### version :1.3.3
|
||||
**time:2019-1-2 14:06:47** <br/>
|
||||
**branch:** master <br/>
|
||||
**update:** <br/>
|
||||
>1. MoneyUtil 扩展元转分
|
||||
#
|
||||
#### version :1.3.2
|
||||
**time:2019-1-2 14:06:47** <br/>
|
||||
**branch:** master <br/>
|
||||
|
2
pom.xml
2
pom.xml
@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>top.yexuejc</groupId>
|
||||
<artifactId>yexuejc-base</artifactId>
|
||||
<version>1.3.2</version>
|
||||
<version>1.3.3</version>
|
||||
|
||||
<name>${project.artifactId}</name>
|
||||
<url>https://github.com/yexuejc/yexuejc-base</url>
|
||||
|
@ -71,4 +71,23 @@ public class MoneyUtil {
|
||||
String str = df.format(bigDecimal);
|
||||
return Integer.parseInt(str);
|
||||
}
|
||||
|
||||
/**
|
||||
* 元转分
|
||||
*
|
||||
* @param num
|
||||
* @return int
|
||||
* @Title: formatPrice
|
||||
* @Description: 元转分
|
||||
* @throw
|
||||
*/
|
||||
public static Long toFen4Long(String num) {
|
||||
if (num == null) {
|
||||
return 0L;
|
||||
}
|
||||
DecimalFormat df = new DecimalFormat("#0");
|
||||
BigDecimal bigDecimal = new BigDecimal(num).multiply(new BigDecimal(100));
|
||||
String str = df.format(bigDecimal);
|
||||
return Long.parseLong(str);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user