class LangUtils {

	public static Object formatValue(Object value, String dataFormat){
		Object actualValue;
		if(value instanceof Date){
			if(StringUtils.isBlank(dataFormat))
				dataFormat = DateUtils.DATE_TIME;
			actualValue = DateUtils.format(dataFormat, (Date)value);
		}else if(value instanceof Number && dataFormat != null) {
			NumberFormat nf = new DecimalFormat(dataFormat);
			nf.setRoundingMode(RoundingMode.HALF_UP);
			actualValue = nf.format(value);
		}else{
			actualValue = value;
		}
		return actualValue;
	}

}