Excel.DoubleCellValue interface
Represents the value of a cell containing a double.
Remarks
Properties
basic |
Represents the value that would be returned by |
basic |
Represents the value that would be returned by |
type | Represents the type of this cell value. |
Property Details
basicType
Represents the value that would be returned by Range.valueTypes
for a cell with this value.
basicType?: RangeValueType.double | "Double";
Property Value
double | "Double"
Remarks
basicValue
Represents the value that would be returned by Range.values
for a cell with this value.
basicValue: number;
Property Value
number
Remarks
type
Represents the type of this cell value.
type: CellValueType.double | "Double";
Property Value
double | "Double"
Remarks
Examples
// 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();
});