Skip to content

Instantly share code, notes, and snippets.

@jiju-MS
Created October 7, 2021 13:55
Show Gist options
  • Save jiju-MS/d67edb37eef4d1d79dc65584b16f8589 to your computer and use it in GitHub Desktop.
Save jiju-MS/d67edb37eef4d1d79dc65584b16f8589 to your computer and use it in GitHub Desktop.
Calculates the volume of a sphere.
name: Basic custom function
description: Calculates the volume of a sphere.
host: EXCEL
api_set: {}
script:
content: |
/**
* Calculates the volume of a sphere.
* @customfunction
* @param {any} radius
* @returns The volume of the sphere.
*/
function setEntity(radius) {
return {
type: "Entity",
basicType: "Error",
basicValue: "#VALUE!",
text: "Entity With API",
properties: {
TestDouble: {
type: "Double",
basicType: "Double",
basicValue: 1,
propertyMetadata: { excludeFrom: { cardView: true } }
},
TestString: { type: "String", basicType: "String", basicValue: "Test" }
}
};
// return {
// type: "FormattedNumber",
// basicValue: 1.23,
// numberFormat: "0.00%",
// };
}
language: typescript
libraries: |
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
@types/office-js
[email protected]/client/core.min.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment