import { isDef } from '@/utils/common/tools';
import { GridSettings } from '@sc/handsontable';

// 费率显示转换 (100需要显示为空)
export default function (
  instance: Handsontable,
  TD: HTMLElement,
  row: number,
  col: number,
  prop: string | number,
  value: any,
  cellProperties: GridSettings
): HTMLElement {
  if (+value === 100 || !isDef(value)) {
    value = '';
  }
  TD.innerHTML = `${value}`;
  TD.className = (cellProperties.className as string) || '';
  return TD;
}
