4种方法,都是四舍五入,例: import java.math.BigDecimal; import java.text.DecimalFormat; import java.text.NumberFormat; public class format { double f = 111231.5585; public void m1() { BigDecimal bg = new BigDecimal(f); double f1 = bg.setScale(2, BigDecimal.ROUND
需求:#将数字填充到对应金额单中 select substr(b.payMoney,length(b.payMoney),1) 分, substr(b.payMoney,length(b.payMoney)-1,1) 角, case when length(b.payMoney)-3 <=0 then '' else substr(b.payMoney,length(b.payMoney)-3,1) end 圆, case when length(b.payMoney)-4 <=0 then
http://blog.csdn.net/huaishuming/article/details/17752365 ********************************************************** 4种方法,都是四舍五入,例: import java.math.BigDecimal; import java.text.DecimalFormat; import java.text.NumberFormat; public class format { doub
import java.math.BigDecimal; import java.text.DecimalFormat; import java.text.NumberFormat; public class format { double f = 111231.5585; public void m1() { BigDecimal bg = new BigDecimal(f); double f1 = bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubl