How do I add a custom function to Google Sheets from the Google Workspace add-on environment?
Note that this question is not about adding a custom functions for an Editor Add-on. This question is about building a Google Workspace add-on.
For reference, assume the custom function I want to add is as follows:
Custom function
function GETTAX( price, rate, ) {
const tax = price * rate;
const dollarUS = Intl.NumberFormat("en-US", {
style: "currency",
currency: "USD",
});
const result = dollarUS.format( tax, );
return result;
}
How can I add a custom function to Sheets when my Google Workspace add-on is open?