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

calculated field displaying number with too many places after the decimal point

So I have three number fields where the user will enter a total number of minutes for each activity performed.  The calculated field will take all three values and add them together to make the value of the new field, which is correctly does.  However, the returned number is "210.000000000", as an example.  I want it to just return "210" as the employee will only be entering whole minutes and there is no need for anything after a decimal point.   I have tried using the following formula, in the "Items" field of that text label where the number appears:

 

Text(TotalActivityMins,"[$-en-US]###")     

 

I actually typed in Text(TotalActivityMins,"###") and Power Apps inserted the '[$-en-US]' on it's own.  This formula doesn't give off an error and it does return the correct value, but still has the 12 extra 0's after the decimal point I don't want.

 

I have also tried just using:   'ThisItem.TotalActivityMins'  and it returns the same result.  I have selected proper configuration settings for decimal places when I created the calculated field initially, setting it to zero, but it doesn't seem to work.

 

Thank you.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: calculated field displaying number with too many places after the decimal point

Hi @Skete211,

 

I think the issue is that PowerApps sees the values coming in from SharePoint as text (even though in SharePoint they're numeric). So to use the ROUND function, you'd first need to convert the text to a value using the VALUE function. This formula worked for me in a datacard, to display the calculated column's value with 0 decimal places:

Round(Value(Parent.Default),0)

Does this help you...?

 

Sandy



Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


6 REPLIES 6
Community Support Team
Community Support Team

Re: calculated field displaying number with too many places after the decimal point

Hi @Skete211,

 

What is your data source here?

 

In addition to Text() function, please take a try with the round function:

For example:

Round(TotalActivityMins, 0 )

Function reference:

Round, RoundDown, and RoundUp functions in PowerApps

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Skete211
Level: Powered On

Re: calculated field displaying number with too many places after the decimal point

@v-micsh-msft

 

Thank you for the reply.  I tried the ROUND function as you suggested by placing it into the text properties box of the label, but it also didn't work.  It gives off an error saying, "Invalid argument type (Text). Expecting a number value instead."  However, this calculated field is supposed to be returning a number:

 

 

actmins.jpg

 

 

 

You can see I also set the number of decimal places in the field property to "0" as well and that also does nothing to truncate the extra decimal places.  Maybe a bug or am I still doing something wrong? 

 

Thanks again!

Super User
Super User

Re: calculated field displaying number with too many places after the decimal point

Hi @Skete211,

 

I think the issue is that PowerApps sees the values coming in from SharePoint as text (even though in SharePoint they're numeric). So to use the ROUND function, you'd first need to convert the text to a value using the VALUE function. This formula worked for me in a datacard, to display the calculated column's value with 0 decimal places:

Round(Value(Parent.Default),0)

Does this help you...?

 

Sandy



Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


Skete211
Level: Powered On

Re: calculated field displaying number with too many places after the decimal point

@SandyU

 

Yes!  It worked and is now displaying the correct number format.  The only modification was changing the 'Parent.Default' to the actual field name.  Thank you!

 

 

Highlighted
Super User
Super User

Re: calculated field displaying number with too many places after the decimal point

That's great, @Skete211 - I'm happy to hear it!

 

Sandy



Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


JTIBCO
Level: Powered On

Re: calculated field displaying number with too many places after the decimal point

Hello SandyU

 

It worked the same (in the same context but in french) and it isn't displaying the correct number format 

(with ou without the modification about the 'Parent.Default' to the actual field name. ).

 

I don't understand ...

 

Jean Pascal