-
In Englishshort versionif we type the raw data long version
var formatstring = cell.CellStyle().GetDataFormatString();
if ("general".equals(formatstring.toLowerCase()))
{
formattedvalue = new CellGeneralFormatter().format(cellvalue);
}
else
{
formattedvalue = new CellNumberFormatter(formatstring).format(cellvalue);
}
Thanks 原生中文版短说版在给EXCEL单元格设定 实际上,VBA的 长话版
var formatstring = cell.CellStyle().GetDataFormatString();
if ("general".equals(formatstring.toLowerCase())) {
formattedvalue = new CellGeneralFormatter().format(cellvalue);
} else {
formattedvalue = new CellNumberFormatter(formatstring).format(cellvalue);
}
谢谢啊 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
In EnglishI found the solution. I just write the answer here in case someone else needs it. But I am using nim-lang elif cell.CellType() == 0: # Numeric
var datafmt = @DataFormatter.new()
var cellvalue = datafmt.FormatCellValue(cell)
return cellvalue
elif cell.CellType() == 2: # Formula
# no need to judge/deal with Cached type?
var datafmt = @DataFormatter.new()
var cellvalue = datafmt.FormatCellValue(cell, @SheetUtil.dummyEvaluator())
however, some format can't be evluated by 中文我,大概,找到了答案 但是有些格式,比如中文日期 |
Beta Was this translation helpful? Give feedback.
In English
I found the solution.
I just write the answer here in case someone else needs it. But I am using nim-lang
however, some format can't be evluated by
dummyEvaluator
, for example,一九〇〇年一月三日
, the date in Chinese, and more. I don't know wether …