smartTable
smartTable copied to clipboard
未占满屏幕时统计不位于底部
想请教下几个设置问题
1.在没沾满一屏幕的情况下,统计行怎么位于界面的底部
2.统计行左右滑动的时候会隐藏显示 隐藏显示 统计的列都是Double 类型
3.表格中的数据为double类型的时候怎么去除掉后面无用的0 ,譬如0.0变成 0 5.30 变成5.3 这种
4.如果 字段用String 自己处理的话,把double转成String 在表格中显示,那么统计列应该可能会统计不出来
问题4:比如统计¥100.5这种字段可以自定义一个ICountFormat来实现: colum1.setCountFormat(new StringRMBCountFormat<>()); public class StringRMBCountFormat<T> implements ICountFormat<T, Double> { private double totalCount = 0.0d;
@Override
public void count(T t) {
if (t instanceof String) {
String value = (String) t;
totalCount += Double.parseDouble(value.replace("¥", ""));
}
}
@Override
public Double getCount() {
return totalCount;
}
@Override
public String getCountString() {
return "¥" + totalCount;
}
@Override
public void clearCount() {
totalCount = 0.0d;
}
}
好的,谢谢大佬 珠海的大佬
问题1:TableProvider>>>>: float bottom = config.isFixedCountRow() ? Math.min(scaleRect.bottom, showRect.bottom) : scaleRect.bottom; 改成 float bottom = showRect.bottom