How do i format decimal numbers in PowerApps? I saw how dates can be formatted...but nothing about formatting decimal numbers. Thanks.
Solved! Go to Solution.
https://powerapps.microsoft.com/en-us/tutorials/function-text/
If you scroll down 3/4 of the page, it has a section on decimals with examples--the output will be text though.
Text(5.678,"#.#") becomes 5.7
If you want to maintain 0, use Text(num,"0.0")
https://powerapps.microsoft.com/en-us/tutorials/function-text/
If you scroll down 3/4 of the page, it has a section on decimals with examples--the output will be text though.
Text(5.678,"#.#") becomes 5.7
If you want to maintain 0, use Text(num,"0.0")
Thanks, this put me on the right track, although I took me a while before I realized that I have to convert the (textual) value to a value before I format it as text again, i.e.
Text(Parent.Default,"[$-en-US]#.0") results in 2 with no decimals
Text(Value(Parent.Default),"[$-en-US]#.0") returns 2.0 with one decimal (even if the value is an integer).
@Beat wrote:Thanks, this put me on the right track, although I took me a while before I realized that I have to convert the (textual) value to a value before I format it as text again, i.e.
Text(Parent.Default,"[$-en-US]#.0") results in 2 with no decimals
Text(Value(Parent.Default),"[$-en-US]#.0") returns 2.0 with one decimal (even if the value is an integer).
@Beat--I am glad you picked up on that!
You might also like this method I use for getting a value if you do not like parentheses:
Text(Parent.Default*1,"[$-en-US]#.0")
Interesting, thank you! So you can multiply by 1 any string that can be converted to a number? Neat.
Hi,
I am currently also trying to get rid of my decimals, but seem to be stuck.
I have a calculated value in minutes as a single line of text, based on two date/time entries.
=GANZZAHL(([Geplanter Einsatztermin Ende]-[Geplanter Einsatztermin])*1440)
The value in this example is 60 minutes, see first attachment, which looks as expected in the Sharepoint item.
Now when I pull this single line of text into my Powerapp, I get the "hostile" decimals (second screenshot) 🙂
I tried this:
Text(ThisItem.Geplante_x0020_Dauer*1; "[$-de-DE]#.0")
and
Text(Value(ThisItem.Geplante_x0020_Dauer); "[$-de-DE]#.0")
But end up only getting more dots in between all the 0s, but no matter what I try the 0 remain.
With this code:
Text(Value(ThisItem.Geplante_x0020_Dauer); "[$-de-DE]#")
I get rid of the dot after the "60", but also the 0s remain 😞
Any ideas?
Thanks a lot in advance!
. (period) | Displays the decimal point in a number. Depends on the language of the custom format, see global apps for more details. |
You need to adjust the format in function of what you're using as decimal separator in German locale.
If it is the comma, try "[$-de-DE]#,0" with a comma instead of a period.
First of all Thanks you verym much for Looking at my issue and soirry for the very late reply.
Following your idea I tried this:
Text(Value(ThisItem.Geplante_x0020_Dauer); "[$-de-DE]#,0")
And got this in return:
Geplante Dauer
600000000000000,0
So yes, the "." after the actual number is gone, but the comma shows at the very end after all those 0s.
Right now I guess I will ignore the 0s and shorten the field in lenght so it looks a tad better.
If you think of anything else I'd love to give it a try.
Cheers
@Bjoern_Jost wrote:First of all Thanks you verym much for Looking at my issue and soirry for the very late reply.
Following your idea I tried this:
Text(Value(ThisItem.Geplante_x0020_Dauer); "[$-de-DE]#,0")And got this in return:
Geplante Dauer
600000000000000,0
So yes, the "." after the actual number is gone, but the comma shows at the very end after all those 0s.
Right now I guess I will ignore the 0s and shorten the field in lenght so it looks a tad better.
If you think of anything else I'd love to give it a try.
Cheers
Try using Substitute function in order to convert "." to "," and vice versa.
Stay up tp date on the latest blogs and activities in the community News & Announcements.
Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
User | Count |
---|---|
199 | |
185 | |
69 | |
42 | |
34 |
User | Count |
---|---|
353 | |
273 | |
124 | |
80 | |
64 |