
Hello Microsoft.
I am sure there used to be a forum for bugs on the community, but I can't seem to find it now.
I found that one of my formulas would randomly stop working and I then found that the "Format Text" option in the formula editor is destroying mathematical order of operations by removing brackets.
If we start with this formula it returns the correct value because we need the subtract to execute first.
PowerApps Order of Operations
If you then choose to format text, it removes the brackets
This then obviously breaks the intended result because of order of operations.
I am pretty sure this is a bug 😉
Dawidvh,
You're not alone. I input this code...
RoundDown ( ( ( DateDiff( CheckInTime, LunchOutTime, Minutes ) + DateDiff( LunchInTime, CheckOutTime, Minutes ) ) / 60 ), 1 )
...and it gives me the correct number. However, when I click "Format Text" I get the following...
RoundDown ( DateDiff( CheckInTime, LunchOutTime, Minutes ) + DateDiff( LunchInTime, CheckOutTime, Minutes ) / 60, 1 )
...which is giving me the wrong number. Quite annoying.
I also discovered that if you use /* --- */ at the end of your code to comment out some code, when you click "Format Text" it will sometimes, but not always, remove all the commented code.