org.jiucai.appframework.common.util
类 ValueFormatUtil

java.lang.Object
  继承者 org.jiucai.appframework.common.util.BaseUtil
      继承者 org.jiucai.appframework.common.util.ValueFormatUtil

public class ValueFormatUtil
extends BaseUtil

数值格式化工具类

作者:
zhaidw

字段摘要
static NumberFormat doubleFormater
           
static NumberFormat longFormater
           
static String nullValue
           
 
从类 org.jiucai.appframework.common.util.BaseUtil 继承的字段
log
 
构造方法摘要
ValueFormatUtil()
           
 
方法摘要
static String formatNullString(Object val)
          判断字符串值为null则返回 nullValue 常量代表的字符串
static String formatNumberString(Object val)
          格式化数字;如果有小数,则保留 doubleFormater 指定的位数
static String formatPercentString(Object val)
          格式化百分比;如果有小数,则保留 doubleFormater 指定的位数
static void main(String[] args)
           
 
从类 org.jiucai.appframework.common.util.BaseUtil 继承的方法
convertMapValue
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

doubleFormater

public static NumberFormat doubleFormater

longFormater

public static NumberFormat longFormater

nullValue

public static String nullValue
构造方法详细信息

ValueFormatUtil

public ValueFormatUtil()
方法详细信息

formatPercentString

public static String formatPercentString(Object val)
格式化百分比;如果有小数,则保留 doubleFormater 指定的位数

参数:
val -
返回:
String

formatNumberString

public static String formatNumberString(Object val)
格式化数字;如果有小数,则保留 doubleFormater 指定的位数

参数:
val -
返回:
String

formatNullString

public static String formatNullString(Object val)
判断字符串值为null则返回 nullValue 常量代表的字符串

参数:
val -
返回:
String

main

public static void main(String[] args)


Copyright © 2013. All Rights Reserved.