JustAnotherLogin Posted August 24, 2021 Report Share Posted August 24, 2021 I am attempting to collect time in seconds and using virtual field and calculated data, place in a table in decimal format. I have in the calculated field the following formula ([@Virtual1]/60) The user input time in seconds (ie. 145) and the field in the data should display 2.416666. But it is not. It is displaying 2 I have attempted using Functions (Str, Round, Abs) and using formatting in the Datapage Elements. The field type in the table is Number. The field is hidden on the datapage. Where is my mistake? Quote Link to comment Share on other sites More sharing options...
0 Tubby Posted August 24, 2021 Report Share Posted August 24, 2021 I think the virtual field is being rendered as an integer which is causing the output to be rounded off to the nearest whole value. Try this formula to convert the virtual field to a float/number data type first before the calculation: CONVERT(FLOAT, [@cbParamVirtual1]) / 60 You can check this article about the CONVERT function:https://howto.caspio.com/function-reference/#:~:text=Miscellaneous Functions and Expressions Quote Link to comment Share on other sites More sharing options...
0 JustAnotherLogin Posted August 24, 2021 Author Report Share Posted August 24, 2021 13 minutes ago, Tubby said: I think the virtual field is being rendered as an integer which is causing the output to be rounded off to the nearest whole value. Try this formula to convert the virtual field to a float/number data type first before the calculation: CONVERT(FLOAT, [@cbParamVirtual1]) / 60 You can check this article about the CONVERT function:https://howto.caspio.com/function-reference/#:~:text=Miscellaneous Functions and Expressions BINGO! Thank you so very much. Domo Arigato. Danke sehr. Merci beaucoup. Gracias. Tubby 1 Quote Link to comment Share on other sites More sharing options...
0 TellMeWhy Posted August 24, 2021 Report Share Posted August 24, 2021 21 minutes ago, JustAnotherLogin said: BINGO! Thank you so very much. Domo Arigato. Danke sehr. Merci beaucoup. Gracias. Since 60 is constant, you can also make it 60.0 , add the .0 so the system will know it's supposed to be float Quote Link to comment Share on other sites More sharing options...
0 Kurumi Posted January 31, 2023 Report Share Posted January 31, 2023 Hello - if you want to use ROUNDDOWN and ROUNDUP like from Excel, you can use these formulas: Excel: Round to last nearest 5 = ROUNDDOWN(A2/5,0)*5 Round to last nearest 10 = ROUNDDOWN(A2/10,0)*10 Round to last nearest 50 = ROUNDDOWN(A2/50,0)*50 Round to last nearest 100 = ROUNDDOWN(A2/100,0)*100 Caspio: FLOOR([@field:Number]/50)*50 Excel: Round to next nearest 5 = ROUNDUP(A2/5,0)*5 Round to next nearest 10 = ROUNDUP(A2/10,0)*10 Round to next nearest 50 = ROUNDUP(A2/50,0)*50 Round to next nearest 100 = ROUNDUP(A2/100,0)*100 Caspio: CEILING([@field:Number]/5)*5 Quote Link to comment Share on other sites More sharing options...
0 Flowers4Algernon Posted February 4, 2023 Report Share Posted February 4, 2023 Hello, this how-to link should also be helpful as you go along: https://howto.caspio.com/datapages/reports/advanced-reporting/calculations-in-forms-and-reports/ Quote Link to comment Share on other sites More sharing options...
Question
JustAnotherLogin
I am attempting to collect time in seconds and using virtual field and calculated data, place in a table in decimal format.
I have in the calculated field the following formula
([@Virtual1]/60)
The user input time in seconds (ie. 145) and the field in the data should display 2.416666. But it is not. It is displaying 2
I have attempted using Functions (Str, Round, Abs) and using formatting in the Datapage Elements.
The field type in the table is Number.
The field is hidden on the datapage.
Where is my mistake?
Link to comment
Share on other sites
5 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.