cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
marnik
Level: Powered On

Calculated SharePoint field appearing as text (and with a period instead of comma) in powerapps form

Hi, I have a PowerApps application connected to a Sharepoint list.  One of the data field in the Sharepoint list is a calculated field, which is displaying exactly as I want it in Sharepoint (with the comma as decimal separator, and rounded to one decimal). 

 

My problem is when that datafield is displayed in my PowerApps application, it is displayed as below, with 14 decimal places and, the most problematic for me, with a period instead of a comma as a decimal separator.  Since my PowerApps language setting is [fr-FR], it doesn't appear that I can convert the 4.06250000000000 to a useable number format in order to round it in PowerApps.

 

Any help will be appreciated.  

Regards, Martin

 

Sharepoint view.jpgPowerApps view.jpg


Accepted Solutions
Microsoft Employee

Re: Calculated SharePoint field appearing as text (and with a period instead of comma) in powerapps

It could be. I can run this successfully in Web Studio in english locale:Capture.PNG

 Try to use the proper separator according to your locale.

Please also note that this is really a workaround for manually handling the formatting on calculated fields.

 


All Replies
Highlighted
Microsoft Employee

Re: Calculated SharePoint field appearing as text (and with a period instead of comma) in powerapps

Hello @marnik,

Unfortunately calculated fields cannot be treated as regular fields. You will have to use a formula in PowerApps to limit the number of digits after the decimal. Does all your values have at least 2 digits after the decimal? If so then you could use something like this:

First(Split(YourValue, ".")).Result & "." & Left(Last(Split(YourValue, ".")).Result, 2)

or to test:

First(Split("4.065434598", ".")).Result & "." & Left(Last(Split("4.065434598", ".")).Result, 2)

...which will return "4.06"

If needed, you can modify this formula so it handles cases when the value has less than 2 digits after decimal.

I hope this helps.

marnik
Level: Powered On

Re: Calculated SharePoint field appearing as text (and with a period instead of comma) in powerapps

Hi , the problem is that in the shown example, the expected value is "4.1" and not "4.0" since I'd need to round up from "4.06" to retain one decimal place.  

Thanks.

Microsoft Employee

Re: Calculated SharePoint field appearing as text (and with a period instead of comma) in powerapps

Sure thing. If you need rounding, try the following: Round(Value(First(Split("4.065434598", ".")).Result & "." & Left(Last(Split("4.065434598", ".")).Result, 2)), 1)
marnik
Level: Powered On

Re: Calculated SharePoint field appearing as text (and with a period instead of comma) in powerapps

@dinusc Thanks very much, I'll give this a try and report back Smiley Happy
marnik
Level: Powered On

Re: Calculated SharePoint field appearing as text (and with a period instead of comma) in powerapps

Unfortunately, it does not work.  See attached image.  The "Value" function yields a "0".   Does this have to do with my locale / language settings? Thank you.

 

screen1.jpg

Microsoft Employee

Re: Calculated SharePoint field appearing as text (and with a period instead of comma) in powerapps

It could be. I can run this successfully in Web Studio in english locale:Capture.PNG

 Try to use the proper separator according to your locale.

Please also note that this is really a workaround for manually handling the formatting on calculated fields.

 

marnik
Level: Powered On

Re: Calculated SharePoint field appearing as text (and with a period instead of comma) in powerapps

Yes! It worked when I used the "," as a decimal separator.  Thank you very much.