Skip to main content

Notifications

Community site session details

Community site session details

Session Id : EK6jVphfNpxTLdz8HADgng
Power Apps - Building Power Apps
Answered

Format a number with thousand and decimal separator

Like (0) ShareShare
ReportReport
Posted on 6 Apr 2023 22:30:03 by 43

Hello Community,

 

I'm creating a label showing a formatted number, big or small, integer or decimal.

For example, this field should show numbers like this:

100

10,000

100,000.25

 

So I used Text() formula:

Text(Number_Value, "#,#.##")

 

but I noticed that in this way the integers will get an unnecessary dot behind them,
like this:

403_1-1680819670919.png

 

Removing ".##" did not work, because it was removing the decimal places and automatically rounding the value.

403_2-1680819732683.png

 

Again, I need to format the numbers like this.
100
10,000
100,000.25
I do not want an integer to have a decimal dot behind it. But I still need a thousand separators.
How can I achieve this?

Categories:
  • elkhawase Profile Picture
    47 on 30 Mar 2024 at 00:19:48
    Re: Format a number with thousand and decimal separator

    thanks, that helped me!

    but I was trying to understand the formula so explaining the above:

     

    t first checks if the remainder of the 'Initial TCV' divided by 1 is non-zero. If it is non-zero, it means there are decimal places in the number

    If there are decimal places, it formats the 'Initial TCV' using "#,###.##" format to display the number with two decimal places

    If there are no decimal places (i.e., the remainder of the division is zero), it formats the 'Initial TCV' using "#,###" format to display the number without decimal places.

    Also, I understand now that the reason you didn't put a complete criteria that Mod should return non zero by default

    when you use a numeric value as a condition, PowerApps automatically evaluates it as true if the value is non-zero and false if the value is zero. Therefore, you don't need to explicitly compare the result of Mod(ThisItem.'Initial TCV', 1) to zero using <> 0.

  • 403 Profile Picture
    43 on 06 Apr 2023 at 23:31:14
    Re: Format a number with thousand and decimal separator

    Thank you @ChrisMendoza,

    It worked like a charm! 🙂

  • Verified answer
    ChrisMendoza Profile Picture
    425 on 06 Apr 2023 at 22:50:20
    Re: Format a number with thousand and decimal separator

    @403 - Maybe something like:

    image.png

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,670 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,015 Most Valuable Professional

Leaderboard
Loading started
Loading complete