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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Convert a String into ...
Power Apps
Answered

Convert a String into a Num

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I'm new into this.

I have the following formula on a Color property of a Label:

<If(Price.Text>= 1000, Red , Gray)>

<Price.Text> returns a String, so logically it doesn't evaluate.

Obvious questions is, how to convert that into a Number.

I tried <Price.Value> but i believe it doesn't work with labels.

 

Many thanks.

Categories:
  • mdevaney Profile Picture
    29,993 Moderator on at

    @Anonymous 

    Use this code instead:

    If(Value(Price.Text)>= 1000, Red , Gray)

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • eka24 Profile Picture
    20,925 on at

    Hi @Anonymous 

    If(Value(Price.Text)>=1000,Red,Grey)

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    It worked, but I´'m not getting the expected result. hum

  • eka24 Profile Picture
    20,925 on at

    What result are you expecting?

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    To get the pricing on the label, above 1000, to be Red, else Gray (this is inside a gallery)

  • mdevaney Profile Picture
    29,993 Moderator on at

    @Anonymous 

    Put my code in the Color property of the label to get the desired result.

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I did that. It doesn't. Weird!

  • mdevaney Profile Picture
    29,993 Moderator on at

    @Anonymous 

    Can you try changing the Format property of TextInput for Price to this code which will only allow a number input?

     

    Format.Number

     

    Then please erase and retype the number in the text box.

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I found out the problem.

    The Text property was:

    ThisItem.Price & "€"

    Erasing the € enabled the color. However I´m left without a currency after the price

  • mdevaney Profile Picture
    29,993 Moderator on at

    @Anonymous 

    Change the Text property of the label to this code to achieve the result with € at the end

     

    Price.Text & “€“

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 271

#3
Mohsin Ali Profile Picture

Mohsin Ali 223

Last 30 days Overall leaderboard