cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
FJA
Frequent Visitor

How to change format text without decimal

Good evening everyone,
I would like in my PowerApps application to be able to change the display of "DistanceParcourue" so that there is no number behind the comma.
This data comes from a SP list and a calculated value column of type number with decimal places set to 0.
I tried several things like:
Text(Substitue(ThisItem.DistanceParcourue;".";",");"#")

or

Text(Substitue(ThisItem.DistanceParcourue;"."";"",");"#")

or

Text(Substitue(ThisItem.DistanceParcourue;"."#))
or
Text (Parent.Default; "[$ - fr] #")


But nothing helps.

Thank you for your help.

1 ACCEPTED SOLUTION

Accepted Solutions

@FJA 

if the calculated column has the format of #.# instead of #,# then this might work:

Round(
      Value(
          Substitute(ThisItem.DistanceParcourue;".";",")
      )
          ;
      2
)

View solution in original post

12 REPLIES 12
Coopedup
Resolver II
Resolver II

Try this....I have the same situation and get the number with lots of 0000000's without it.

Text(Value(Parent.Default))

 

timl
Super User
Super User

Hi @FJA The reason for this is the combination of using a calculated column, along with a French locale where semi-colon is the decimal separator, rather than a comma.

There are more details here.

https://powerusers.microsoft.com/t5/Building-Power-Apps/change-the-number-of-decimals-for-a-number/m...

 

In addition to @Coopedup's advice, you can also try using the Round function.

Round(
      Value(ThisItem.DistanceParcourue),
      2
)

 

FJA
Frequent Visitor

Hi @timl 

Thanks for your help.

But it doesn't work (see joined picture) 😢

 

Thanks to you and have a good day

FJA
Frequent Visitor

Hi @Coopedup , 

Thaks for your help.

But your solution doesn't work. (see the joined picture).

indeed, if I put this function, I no longer have any result displayed

 

Thanks and have a good day

Hi @FJA 

I don't know if it helps, but in the German version ";" ist used to separate elements instead of ",". Perhaps it's similar in the French version as well. Using @timl's code maybe this change works then:

Round(
      Value(ThisItem.DistanceParcourue);
      2
)

 

FJA
Frequent Visitor

Hi @_Nils_ 

Thanks for your help.

I have the same result as with the function of @timl (see joined picture).

 

Have a good day

Hi @FJA 

it actually seems like it works. It looks like you don't have an error any more but a result of "0" instead.

What is the actual number behind ThisItem.DistanceParcourue? Maybe the number is so small that the Round function rounds it down to 0.

 

FJA
Frequent Visitor

@_Nils_ 

I must have 80 as a result

This column is a claculated column : KMarrivee-KMdepart

@FJA 

okay, an what is the actual number stored in the SP list for ThisItem.DistanceParcourue?

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,377)