I'm trying to format the output of an expression as a percentage to be shown in a table. With a normal cell, appmaker lets you select the dropdown to #formatNumber. I can't figure out how to do this with a longer expression:
@datasource.item.ROI_Percent * (365/(@datasource.item.Sale_Date - @datasource.item.PO_Date))
I've tried throwing the whole thing in parens and adding #formatNumber but that doesn't seem to work. Is there another function I'm missing? I want this to be a rounded percentage (704%)
Thanks
Once you break away from a single bound output, App Maker can no longer determine the result type and thus doesn't allow you to use their helper functions. You'll have to use plain old javascript.
Here's one way to format as a percentage:
(@datasource.item.ROI_Percent * (365/(@datasource.item.Sale_Date - @datasource.item.PO_Date))).toLocaleString("en", {style: "percent"})