⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 integerformatter.java

📁 sample目录下是例子程序。 1.分组汇总例子 TestGroupReport.java 2.交叉报表例子 TestCrossReport.java 需要使用crossTabSample.x
💻 JAVA
字号:
package com.lucaslee.report;

import java.text.DecimalFormat;
import java.text.ParseException;

/**
 * 空白的数据格式化类,不做格式化处理。
 * <p>
 * Title:
 * </p>
 * <p>
 * Description:
 * </p>
 * <p>
 * Copyright: Copyright (c) 2003
 * </p>
 * <p>
 * Company:Lucas-lee Soft
 * </p>
 * 
 * @author Lucas Lee
 * @version 1.0
 */
public class IntegerFormatter implements Formatter {

	private DecimalFormat f = new DecimalFormat();

	public IntegerFormatter() {
		// TODO 应进行4舍5入

		// 确定小数位数
		f.setMaximumFractionDigits(0);
		f.setMinimumFractionDigits(0);
	}

	/**
	 * 参考父类文档
	 * 
	 * @param str
	 * @return
	 * @throws ParseException
	 */
	public String format(String str) throws ParseException {
		double temp = f.parse(str).doubleValue();

		return f.format(temp);

	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -