var range = new GC.Spread.Sheets.Range(
newRow || cellRange.row,
c,
1,
1
);
var value = GC.Spread.Sheets.CalcEngine.rangeToFormula(
range,
0,
0,
GC.Spread.Sheets.CalcEngine.RangeReferenceRelative.allRelative
);
let dv_num =
GC.Spread.Sheets.DataValidation.createFormulaValidator(
`=TRUNC(${value},${cellValid.value})=${value}`
);
dv_num.highlightStyle(highlightStyleMap);
dv_num.inputTitle(`数字验证${cellIgnoreBlank ? "" : "/必填"}`);
dv_num.inputMessage(
`保留${cellValid.value ? cellValid.value : "0"}位小数`
);
sheet.setDataValidator(
newRow || cellRange.row,
c,
newRow || cellRange.rowCount,
1,
dv_num
);
break; |