Skip to content

Commit c95f867

Browse files
[Excel] (Custom functions) Switch formatted number content to double (#5246)
* [Excel] (Custom functions) Switch formatted number content to double * Fix broken cross link * Adjust to emphasize purpose of a double * Apply suggestions from code review Co-authored-by: Alex Jerabek <[email protected]> --------- Co-authored-by: Alex Jerabek <[email protected]>
1 parent ab480ee commit c95f867

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

docs/excel/custom-functions-data-types-concepts.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
---
22
title: Custom functions and data types
33
description: Use Excel data types with your custom functions and Office Add-ins.
4-
ms.date: 06/15/2025
4+
ms.date: 06/22/2025
55
ms.topic: overview
66
ms.custom: scenarios:getting-started
77
ms.localizationpriority: medium
88
---
99

1010
# Use data types with custom functions in Excel
1111

12-
Data types expand the Excel JavaScript API to support data types beyond the original four cell value types (string, number, boolean, and error). Data types include support for web images, formatted number values, entities, and arrays within entities.
12+
Data types expand the Excel JavaScript API to support data types beyond the original four cell value types (string, number, boolean, and error). Data types include support for web images, formatted numbers, entities, and arrays within entities.
1313

1414
These data types amplify the power of custom functions, because custom functions accept data types as both input and output values. You can generate data types through custom functions, or take existing data types as function arguments into calculations. Once the JSON schema of a data type is set, this schema is maintained throughout the calculations.
1515

@@ -28,21 +28,21 @@ Custom functions projects include a JSON metadata file. This JSON metadata file
2828

2929
For a full description of the manual JSON metadata creation process, see [Manually create JSON metadata for custom functions](custom-functions-json.md). See [allowCustomDataForDataTypeAny](custom-functions-json.md#allowcustomdatafordatatypeany) for additional details about this property.
3030

31-
## Output a formatted number value
31+
## Output a formatted number
3232

33-
The following code sample shows how to create a [FormattedNumberCellValue](/javascript/api/excel/excel.formattednumbercellvalue) data type with a custom function. The function takes a basic number and a format setting as the input parameters and returns a formatted number value data type as the output.
33+
The following code sample shows how to create a formatted number with a custom function. This uses the [DoubleCellValue](/javascript/api/excel/excel.doublecellvalue) object. The function takes a basic number and a format setting as the input parameters and returns a formatted number as double data type for the output.
3434

3535
```js
3636
/**
37-
* Take a number as the input value and return a formatted number value as the output.
37+
* Take a number as the input value and return a double as the output.
3838
* @customfunction
3939
* @param {number} value
4040
* @param {string} format (e.g. "0.00%")
4141
* @returns A formatted number value.
4242
*/
4343
function createFormattedNumber(value, format) {
4444
return {
45-
type: "FormattedNumber",
45+
type: "Double",
4646
basicValue: value,
4747
numberFormat: format
4848
}

docs/excel/custom-functions-get-started.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: Tips and best practices for Excel custom functions in your Office Add-ins.
33
title: Best practices for custom functions in Excel
4-
ms.date: 12/20/2024
4+
ms.date: 06/22/2025
55
ms.topic: overview
66
ms.custom: scenarios:getting-started
77
ms.localizationpriority: medium
@@ -94,7 +94,7 @@ Another way to return multiple results is to use multiple functions and return a
9494

9595
### Complex data structures
9696

97-
[Data types](custom-functions-data-types-concepts.md) are the best way to handle complex data structures in custom functions add-ins. Data types support [Excel errors](custom-functions-errors.md) and [formatted number values](custom-functions-data-types-concepts.md#output-a-formatted-number-value). Data types also allow for designing [entity value cards](excel-data-types-entity-card.md), extending Excel data beyond the 2-dimensional grid.
97+
[Data types](custom-functions-data-types-concepts.md) are the best way to handle complex data structures in custom functions add-ins. Data types support [Excel errors](custom-functions-errors.md) and formatted numbers as [doubles](custom-functions-data-types-concepts.md#output-a-formatted-number). Data types also allow for designing [entity value cards](excel-data-types-entity-card.md), extending Excel data beyond the 2-dimensional grid.
9898

9999
## Improve the user experience of calls to external services
100100

0 commit comments

Comments
 (0)