美文网首页
java添加千分位

java添加千分位

作者: haiyong6 | 来源:发表于2018-07-01 10:20 被阅读0次

    /**
    * 添加千分位
    * @param str
    * @return
    */
    public static String format(String str)
    {
    if(!isEmpty(str) && !"-".equals(str))
    {
    DecimalFormat df = new DecimalFormat("###,###");
    try {
    str = df.format(Long.parseLong(str));
    } catch (Exception e) {
    return str;
    }
    }
    return str;
    }

    相关文章

      网友评论

          本文标题:java添加千分位

          本文链接:https://www.haomeiwen.com/subject/xhbxvxtx.html