次の方法で共有


Excel.DoubleCellValue interface

double を含むセルの値を表します。

注釈

[ API セット: ExcelApi 1.16 ]

プロパティ

basicType

この値を持つセルの Range.valueTypes によって返される値を表します。

basicValue

この値を持つセルの Range.values によって返される値を表します。

type

このセル値の型を表します。

プロパティの詳細

basicType

この値を持つセルの Range.valueTypes によって返される値を表します。

basicType?: RangeValueType.double | "Double";

プロパティ値

double | "Double"

注釈

[ API セット: ExcelApi 1.16 ]

basicValue

この値を持つセルの Range.values によって返される値を表します。

basicValue: number;

プロパティ値

number

注釈

[ API セット: ExcelApi 1.16 ]

type

このセル値の型を表します。

type: CellValueType.double | "Double";

プロパティ値

double | "Double"

注釈

[ API セット: ExcelApi 1.16 ]

// 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();
});