cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Convert a String into a Num

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.

1 ACCEPTED SOLUTION

Accepted Solutions

@Anonymous 

Change the Color property of your label to this code:

 

If(ThisItem.Price>=1000, Red, Black)

 

---
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."

View solution in original post

28 REPLIES 28
mdevaney
Super User III
Super User III

@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
Super User III
Super User III

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.

Anonymous
Not applicable

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

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.

Anonymous
Not applicable

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

@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."

Anonymous
Not applicable

I did that. It doesn't. Weird!

@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."

Anonymous
Not applicable

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

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (18,449)