Expression Yields Different Results Based on Function

I use `HOUR([Total Hours])+MINUTE([Total Hours])/60+SECOND([Total Hours])/60/60` to generate a decimal conversion of hours worked on our time clock.

When I put it in the app Formula for Total_Hours and make a change to the table, it works. When I do the same thing through a bot, it rounds down the decimals, always resulting in .00, no matter how many minutes or seconds they worked. 

I also have the structure to use `[Hours]+[Minutes]/60+[Seconds]/60/60`

I have tried both expressions, and they yield the same results, depending on whether they're in the app formula or a data action "Set Row Values" in a bot. App formula with both yields a correct calculation. Example: The app formula yields 7.62, and the bot yields 7.00.

I have also tried playing with the number format on the Google Sheet in that specific column to no avail. Any help is appreciated.

Solved Solved
0 2 105
1 ACCEPTED SOLUTION

You may want to add what you mean by 


@rmsmeltz wrote:

When I put it in the app Formula for Total_Hours and make a change to the table, it works


Do you mean you make changes directly to the back end table or in the app?

In general please try using an expression of 

HOUR([Total Hours])+MINUTE([Total Hours])/60.00+SECOND([Total Hours])/3600.00

You could also use the TOTALHOURS() function more easily to achieve the same result instead of a longer expression.

TOTALHOURS([Total Hours])

TOTALHOURS() - AppSheet Help

 

 

 

 

View solution in original post

2 REPLIES 2

You may want to add what you mean by 


@rmsmeltz wrote:

When I put it in the app Formula for Total_Hours and make a change to the table, it works


Do you mean you make changes directly to the back end table or in the app?

In general please try using an expression of 

HOUR([Total Hours])+MINUTE([Total Hours])/60.00+SECOND([Total Hours])/3600.00

You could also use the TOTALHOURS() function more easily to achieve the same result instead of a longer expression.

TOTALHOURS([Total Hours])

TOTALHOURS() - AppSheet Help

 

 

 

 

Thank you. The TOTALHOURS() works perfectly!

Top Labels in this Space