How to Show Two Decimal Places in Power Automate HTML Tables
Question details
The user needs to retain trailing zeros and format numeric values to two decimal places when generating HTML tables from Excel data in Power Automate, as well as calculate accurate totals.

- Product
- Excel, Power Automate
- Device & OS
- not provided
- Scenario
- Pulling financial data from an Excel spreadsheet to generate properly formatted HTML tables using Power Automate workflows.
- Observed behavior
- Power Automate automatically strips trailing zeros from Excel currency values (e.g., changing $24.00 to 24), causing HTML tables to display inconsistently formatted numbers.
Ensure your source Excel spreadsheet has the relevant columns formatted properly and remove any pre-calculated Grand Total rows before importing the data into Power Automate.
Use the Format Number Action and XPath for Totals
Correct your source Excel formatting, then use Power Automate's native 'Format number' action and an XPath expression to display consistent decimal places and calculate totals efficiently.
Because Power Automate reads the raw numeric values from Excel rather than their display formatting, trailing zeros are dropped. You must explicitly reformat these numbers within the flow and use proper variable structures to handle multiple locations or rows.
Open your source Excel table. Format the Amount column as 'Number' (not Currency) and completely delete any existing Grand Total rows at the bottom of your table to prevent Power Automate from treating the total as a standard data row.
At the beginning of your Power Automate flow, add an 'Initialize variable' action. Set its type to 'Array' and set the initial value to an empty array by simply typing [] in the value field.
Use a 'Select' action to map your array values using the expression item()?['Amount']. Next, insert a 'Format number' action targeting those selected values, and apply a format string like '0.00' to enforce exactly two decimal places for your HTML table.
To get the grand total without nesting another 'Apply to each' loop, build an XML object containing your numerical array (using a Compose action). Then, use a compose expression like xpath(xml(outputs('Compose_Name')), 'sum(/root/Numbers)') to calculate the sum.

Prepare Your Spreadsheet Data Easily with WPS Office
While Power Automate handles your automated workflows, you still need a robust spreadsheet editor to prepare, format, and organize your source data. WPS Office provides a free, lightweight alternative to Microsoft Excel with complete compatibility for .xlsx files, making it the perfect companion for managing your automation datasets.
- 1. Open your data file: Launch WPS Spreadsheet and open the .xlsx file you intend to use as your Power Automate data source.
- 2. Format your number columns: Highlight the columns containing your amounts, right-click, and select 'Format Cells'. Choose the 'Number' category and set decimal places to 2.
- 3. Save and sync: Save your file. The strict formatting will be embedded into the workbook, ensuring a clean data structure when read by your workflow.

Frequently Asked Questions
Why does Power Automate remove trailing zeros from my Excel amounts?
When Power Automate retrieves data from Excel, it reads the raw underlying numeric value, not the visual formatting applied in the spreadsheet. As a result, a formatted value like $24.00 is pulled simply as 24, dropping the currency symbol and trailing zeros.
What value should I use when initializing an array variable in Power Automate?
When setting up an 'Initialize variable' action for an array, you should set its initial value to an empty array. You can do this by typing an open and close square bracket: [].
How can I avoid using multiple 'Apply to each' loops for calculating totals?
You can calculate totals efficiently by converting your array of composed numbers into an XML format. Once converted, apply an XPath sum expression, such as xpath(xml(outputs('Your_Compose_Name')), 'sum(/root/Numbers)'), which instantly calculates the total without iterating through a loop.
Why is my expression in the 'Append to array variable' action showing as invalid?
This error typically occurs if the expression syntax is malformed or if the action itself is placed outside of the necessary 'Apply to each' loop. Row-specific data processing must happen inside the loop that iterates over your Excel rows.




