web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / display a negative num...
Power Apps
Unanswered

display a negative number in parentheses

(0) ShareShare
ReportReport
Posted on by 2

How do you display a negative number in a textbox or label with parentheses instead of the minus sign?

For example my value is -5. 

I want to show it as (5).

How do I format that in a label or textbox?

Categories:
I have the same question (0)
  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hi @JohnnyDataGuy 

     

    Can you try to update the expression as:

    "("&Match("-5", "-(?<numvalue>\d+)?").numvalue&")"

     

    Hope this Helps!

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • Verified answer
    v-xida-msft Profile Picture
    on at

    Hi @JohnnyDataGuy ,

    Do you want to display a negative number within a Text Input Box or Label using parentheses rather than minus sign?

     

    I have made a test on my side, please consider take a try with the following workaround:

    7.JPG

     Set the Default property of the Text Input Box2 to following:

    If(
     IsMatch(TextInput1.Text, "\-\d+(\.\d+)?"),
     "(" & Substitute(TextInput1.Text, "-", "") & ")",
     TextInput1.Text
    )

    On your side, you may need to type the following:

    If(
     IsMatch(Text(YourNegativeNumberValue), "\-\d+(\.\d+)?"),
     "(" & Substitute(Text(YourNegativeNumberValue), "-", "") & ")",
     TextInput1.Text
    )

    Please consider take a try with above solution, check if the issue is solved.

     

    More details about the IsMatch function in PowerApps, please check the following article:

    IsMatch function

     

    Best regards,

  • JohnnyDataGuy Profile Picture
    2 on at

    Thank You!

  • Community Power Platform Member Profile Picture
    on at

    For those who are wondering, there is an easier way...

     

    ABS(-5)

     

    😊

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard