cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TKHeng
Frequent Visitor

Format number in a table column

Hi,

Is there a way to format this table column amount to be a number with decimals?

 

TKHeng_0-1645932225423.png

 

This is the email that I received. I want all the number to have two decimals point.

TKHeng_0-1645932305258.png

 

Thanks

 

1 ACCEPTED SOLUTION

Accepted Solutions

I think this error is occurring because some of your  'Tax Amount' values are empty and do not contain any values? For example:

  {
    "Client Name": "Alex Wilber",
    "Email": "Alex@home.net",
    "Vendor Name": "Safe Systems Ltd",
    "Due Date": "2022-09-22",
    "Tax Amount": ""
  }

If this is the case, you can extend the expression to test for empty or missing values and return $0.00:

if(empty(item()?['Tax Amount']),'$0.00',formatNumber(float(item()?['Tax Amount']),'C2'))

ekarim2020_0-1646000922445.png

Snag_a70eeef.png

 


Ellis
____________________________________
If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

6 REPLIES 6
ekarim2020
Super User
Super User

There is a FormatNumber function that you can use. Here are some examples:

 

Snag_7ecd171.png

Snag_7e7662c.png
Ellis
____________________________________
If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.

Hi Ellis,

I get an error. I don't really know how to resolve it. Could you please help?

 

TKHeng_0-1645971383499.png

 

The Tax Amount property is text. You will need to convert the the string into a number (float).

Please try:

formatNumber(float(item()?['Tax Amount']), 'C2')

 
Ellis
____________________________________
If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.

Tried and unfortunately, it didn't work. Still getting error, any other possible option? thanks

 

TKHeng_0-1645992704906.png

 

I think this error is occurring because some of your  'Tax Amount' values are empty and do not contain any values? For example:

  {
    "Client Name": "Alex Wilber",
    "Email": "Alex@home.net",
    "Vendor Name": "Safe Systems Ltd",
    "Due Date": "2022-09-22",
    "Tax Amount": ""
  }

If this is the case, you can extend the expression to test for empty or missing values and return $0.00:

if(empty(item()?['Tax Amount']),'$0.00',formatNumber(float(item()?['Tax Amount']),'C2'))

ekarim2020_0-1646000922445.png

Snag_a70eeef.png

 


Ellis
____________________________________
If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.

TKHeng
Frequent Visitor

Thank you very much Ellis!, you are a genius! 🙂😀

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Users online (2,897)