*转JSONObject;String.substring;数据相减

public static void main(String[] args) throws ParseException {
        Map map = new HashMap();
        map.put("PomRefund", "1");
        map.put("PomBalance", "0");
        map.put("PomReport", "1");
        
        JSONObject jb = JSONObject.fromObject(map);
        String pression = jb.toString();
        System.out.println(pression);
        
        JSONObject json = JSONObject.fromObject(pression);
        Map p = json;
        
        String PomRefund = (String)p.get("PomRefund");
        System.out.println(PomRefund);
        
        String PomBalance = (String)p.get("PomBalance");
        System.out.println(PomBalance);
        
        String PomReport = (String)p.get("PomReport");
        System.out.println(PomReport);
        //{"POM_REFUND":"1","POM_BALANCE":"1","POM_REPORT":"0"}
        
        /*Map<String,String> params = getParams();
        sign(params);
        unsign(params);*/
        /*String bizDate = "2019-02-12 16:18:42";
        String a= bizDate.substring(0, 4);
        String b = bizDate.substring(5, 7);
        String c = bizDate.substring(8, 10);
        bizDate =a+b+c+"000000";
        String d =a+b+c+"235959";
        System.out.println(":" + bizDate);*/
        
        /*String a = "1011.80";
        String b = "108.66";
        if(StringUtils.isNotBlank(a) && StringUtils.isNotBlank(b)){
            BigDecimal bd1 = new BigDecimal(a);
            bd1 = bd1.setScale(2, BigDecimal.ROUND_HALF_UP);
            BigDecimal bd2 = new BigDecimal(b);
            bd2 = bd2.setScale(2, BigDecimal.ROUND_HALF_UP);
            BigDecimal bd3 =bd1.subtract(bd2);
            System.out.print(bd3);
            String bd3String = bd3.toString();
            System.out.print(bd3String);
        }*/
        
    }
 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值