Excel.DoubleCellValue interface
表示包含双精度的单元格的值。
注解
属性
basic |
表示将为具有此值的单元格返回 |
basic |
表示将为具有此值的单元格返回 |
type | 表示此单元格值的类型。 |
属性详细信息
basicType
表示将为具有此值的单元格返回 Range.valueTypes
的值。
basicType?: RangeValueType.double | "Double";
属性值
double | "Double"
注解
basicValue
type
表示此单元格值的类型。
type: CellValueType.double | "Double";
属性值
double | "Double"
注解
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/20-data-types/data-types-formatted-number.yaml
// This function creates a double data type,
// and sets the format of this data type as a date.
await Excel.run(async (context) => {
// Get the Sample worksheet and a range on that sheet.
const sheet = context.workbook.worksheets.getItemOrNullObject("Sample");
const dateRange = sheet.getRange("A1");
// Write a number formatted as a date to cell A1.
dateRange.valuesAsJson = [
[
{
type: Excel.CellValueType.double,
basicValue: 32889.0,
numberFormat: "m/d/yyyy"
}
]
];
await context.sync();
});