Jump to content
  • 0

Calculated value not returning decimals


JustAnotherLogin

Question

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

  • 0

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

image.png.bcb5db66516cc0e9e39072ec980396a2.png
You can check this article about the CONVERT function:
https://howto.caspio.com/function-reference/#:~:text=Miscellaneous Functions and Expressions

Link to comment
Share on other sites

  • 0
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

image.png.bcb5db66516cc0e9e39072ec980396a2.png
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.

Link to comment
Share on other sites

  • 0

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

 

Link to comment
Share on other sites

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.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...