|
|
|
@ -503,26 +503,15 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
taxRateDetail = detail.get("taxRate").toString(); |
|
|
|
|
if (!"0".equals(taxRateDetail)) { |
|
|
|
|
if (StringUtils.isNoneBlank(taxRateDetail)) { |
|
|
|
|
int index = taxRateDetail.indexOf("%"); |
|
|
|
|
if (index > 0) { |
|
|
|
|
taxRateDetail = taxRateDetail.substring(0, taxRateDetail.length() - 1); |
|
|
|
|
Float num = Float.parseFloat(taxRateDetail); |
|
|
|
|
if (num > 9) { |
|
|
|
|
taxRateDetail = "0." + taxRateDetail; |
|
|
|
|
} else { |
|
|
|
|
if (!taxRateDetail.startsWith("0")) { |
|
|
|
|
taxRateDetail = "0.0" + taxRateDetail; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
Float num = Float.parseFloat(taxRateDetail); |
|
|
|
|
if (num > 9) { |
|
|
|
|
taxRateDetail = "0." + taxRateDetail; |
|
|
|
|
} else { |
|
|
|
|
if (!taxRateDetail.startsWith("0")) { |
|
|
|
|
taxRateDetail = "0.0" + taxRateDetail; |
|
|
|
|
} |
|
|
|
|
if (taxRateDetail.contains("%")) { |
|
|
|
|
taxRateDetail = taxRateDetail.replace("%",""); |
|
|
|
|
} |
|
|
|
|
BigDecimal tax = new BigDecimal(taxRate); |
|
|
|
|
BigDecimal tax1 = tax.divide(new BigDecimal("100")); |
|
|
|
|
if (tax.compareTo(new BigDecimal("1")) < 1) { |
|
|
|
|
taxRateDetail = tax.toPlainString(); |
|
|
|
|
}else { |
|
|
|
|
taxRateDetail = tax1.toPlainString(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -1272,8 +1261,8 @@ public class SDNYMainProcessController extends AbstractController { |
|
|
|
|
public static void main(String[] args) { |
|
|
|
|
DecimalFormat decimalFormat = new DecimalFormat("#.00"); |
|
|
|
|
String formattedDecimal = decimalFormat.format(new BigDecimal("15")); |
|
|
|
|
BigDecimal bigDecimal = new BigDecimal("101"); |
|
|
|
|
boolean b = bigDecimal.compareTo(new BigDecimal("110")) < 1; |
|
|
|
|
BigDecimal bigDecimal = new BigDecimal("0.13"); |
|
|
|
|
boolean b = bigDecimal.compareTo(new BigDecimal("1")) < 1; |
|
|
|
|
System.out.println(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|