cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Meneghino
Level 10

Bug report: Formatting string leaves stray decimal point

Text(29, "[$-en-GB]#,##0.##", "en-GB") will give "29." with a stray decimal point, and not "29" as it should.

Thank you for fixing the previous display bugs in version 2.0.630.

@AndyPennell may be interested in this.

1 ACCEPTED SOLUTION

Accepted Solutions
Power Apps Staff AndyPennell
Power Apps Staff

Re: Bug report: Formatting string leaves stray decimal point

Excel produces the same value as PowerApps for this format string, so I claim PowerApps is running correctly. The rules for numeric format strings are strange and sometimes unexpected. We do our very best to poduce the same results as Excel, no matter how bizarre it seems to be.

View solution in original post

4 REPLIES 4
Power Apps Staff AndyPennell
Power Apps Staff

Re: Bug report: Formatting string leaves stray decimal point

Excel produces the same value as PowerApps for this format string, so I claim PowerApps is running correctly. The rules for numeric format strings are strange and sometimes unexpected. We do our very best to poduce the same results as Excel, no matter how bizarre it seems to be.

View solution in original post

mr-dang
Level 10

Re: Bug report: Formatting string leaves stray decimal point

Would it be possible to wrap a condition around it that deletes the last decimal?

 

It's unnecessarily complicated, but here's an example:

If(Right(Text(29, "[$-en-GB]#,##0.##", "en-GB"),1)=".",
    Left(Text(29, "[$-en-GB]#,##0.##", "en-GB"),Len(Text(29, "[$-en-GB]#,##0.##", "en-GB"))-1),
    Text(29, "[$-en-GB]#,##0.##", "en-GB")
)

This means, "If the right-most character in a string ends in a stray decimal, display the value as the length of all the characters minus the last character." It's not much of a solution though.

Microsoft Employee
@8bitclassroom
Meneghino
Level 10

Re: Bug report: Formatting string leaves stray decimal point

Thanks for following up @AndyPennell, I respect your approach, although IMHO I would strive not to reproduce bugs in other applications. In any case this is not critical since it does not affect the mathematical result but just looks a bit clunky.

Meneghino
Level 10

Re: Bug report: Formatting string leaves stray decimal point

Hi @mr-dang, thanks for the reply.

This is the shortest work-around I could come up with:

Text(29, "[$-en-GB]#,##0"&If(29<>RoundDown(29,0),".##"), "en-GB")

Best regards.

Helpful resources

Announcements
thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,465)