Hi community,
I have a form that shows me various data, one of which is a number, how could I configure this label so that it shows me the number with a single decimal?.
Regards,
Francisco
Hi @Francisco77 ,
please try this code
Text(Round(YourNumber, 1), "0.0")
If this solution resolves your issue, please consider marking it as accepted. ✅
Warm regards,
Muhammad Ali
What's the data type of your 'TOTAL TARGET HECTARES' column? Is it possibly a SharePoint calculated column? If not, is it a number column?
Replace the comma (,) with a dot (.)
Text(ThisItem.'TOTAL TARGET HECTARES'; "#.#")
You could also try Round()
Round(ThisItem.'TOTAL TARGET HECTARES', 1)
If you have any questions or feedback, please let me know. Have a great day! 😊
-----------------------
PowerYsa Power Platform Enthusiast [LinkedIn] | [Youtube]
I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my [@PowerYSA] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻
Hi @Francisco77 ,
In Power Apps, if you want to format a number to show only a single decimal place, you can use the Text function to format the number accordingly. Here's an example of how you can format a label to show a number with one decimal place:
Text(YourNumber, "0.0")
Replace YourNumber with the actual data source or field name that contains your number. When you set the Text property of the label to this formula, it will display the number rounded to one decimal place.
Here is how you might apply it in the context of your form:
Text(ThisItem.TotalTarget, "0.0")
This will ensure the label shows the number with only one decimal place, as requested.
If this solution resolves your issue, please consider marking it as accepted. ✅
Warm regards,
Muhammad Ali
Hi @Francisco77
//Method 1
Text(MyNumber, "#.#") //Text(123.456, “#.#”) will return "123.5"
//Method 2
Round(MyNumber, 1) // Round(123.456, 1) will return 123.5
If you have any questions or feedback, please let me know. Have a great day! 😊
-----------------------
PowerYsa Power Platform Enthusiast [LinkedIn] | [Youtube]
I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my [@PowerYSA] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻
WarrenBelz
146,660
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,999
Most Valuable Professional