1234567891011121314151617181920212223242526272829303132333435363738394041 |
- package com.caimei.utils;
- import com.caimei.module.pay.util.MathUtil;
- import org.apache.commons.lang.StringUtils;
- public class ExcelNumberFormatter {
-
- public String format(String bigDecimal){
- if(bigDecimal == null){
- return StringUtils.EMPTY;
- }else{
- return MathUtil.round(bigDecimal,2).toString();
- }
- }
- public Double formatStr(String bigDecimal){
- if(bigDecimal == null){
- return 0.00;
- }else{
- return MathUtil.round(bigDecimal,2).doubleValue();
- }
- }
- public String formatDouble(Double number){
- if(number == null){
- return StringUtils.EMPTY;
- }else{
- return MathUtil.round(number.toString(),2).toString();
- }
- }
- public String addStr(Object str1, Object str2) {
- if (str1 == null || str2 == null) return "";
- return str1.toString() + str2.toString();
- }
- public String addStrings(Object str1, Object str2, Object str3, Object str4) {
- if (str1 == null || str2 == null || str3 == null || str4 == null) return "";
- return str1.toString() + str2.toString() + str3.toString() + str4.toString();
- }
- }
|