VC value changed after saving

Hi you all!

I am having some trouble with a virtual column on a shift tracker app.

I have:
[Start] and [Finish] columns as DateTime
[Deductible Break] as Duration

[Units] as Enum (“per day” or “per hour”)

VC [Payable] with the formula:
[Finish]-[Start]-[Deductable Break]

VC [Pay] as Decimal with the formula:
IF(HOUR([Payable])+(MINUTE([Payable])/60)<8,8,HOUR([Payable])+(MINUTE([Payable])/60))
(minimum 8hrs paid)

[Rate] as Price

VC [Subtotal] as Price with the formula:
IF([Units]=per day,[Rate],[Rate]*[Pay])

!!!ISSUE!!!

If the [Units] is set to “per day” and the [Rate] will be 102.50 then the [Subtotal] will stay be and stay as 102.50.

If the [Units] is set to “per hour” and the result will be 102.50, this will be shown in the form and after saving but after sync, it will round it up to 100.

Can’t find where the rounding up is happening.

Any clues?

Thanks!

In the form:
3X_b_0_b01913cf72cdb5182be999b0dd8524a8c4481590.png

Detail:
3X_c_f_cf896f4bbd80a748815987cd7883260d6e8034d9.png

After sync:
3X_b_a_baf3209e051807ea1282329123b3204519b53ff5.png

Solved Solved
0 9 368
1 ACCEPTED SOLUTION

Could you please try with
IF(HOUR([Payable])+(MINUTE([Payable])/60)<8.00,8.00,(HOUR([Payable])) * 1.00+(MINUTE([Payable])/60.00))

Edit: Minor modification to the expression

View solution in original post

9 REPLIES 9

It most likely has to do with decimal vs number… Maybe take that whole expression, and wrap it with a *1.0 see if that does it, then hone in on exactly where to make that tweak.

Thank you!
Just tried it but it still does the same thing

Could you please try with
IF(HOUR([Payable])+(MINUTE([Payable])/60)<8.00,8.00,(HOUR([Payable])) * 1.00+(MINUTE([Payable])/60.00))

Edit: Minor modification to the expression

ok, it works! thank you!

WHY?
What’s *1.00 doing and what’s /60.00 doing?

I believe @Steve may give correct explanation. I will try.

However as per my understanding , the earlier expression was giving a rounded number value , because even though the column type is DECIMAL , all expression calculations were based on NUMBER types. I believewith reference to the help document below, the earlier expression was equivalent of first example in the help document , that is DECIMAL(10 / 3) = (3.0)

I may be incorrect in my above explanation.

I suggested revised expression by previous experience of working with decimal calculations and of course some testing in similar test scenario.

Click through the below for more on this issue:

@Suvrutt_Gurjar Thanks for getting in there!

Hi @Grant_Stead,

Thank you. I just further expanded on your hint of gettting the expression into decimal format from number format.

In general I try to allow a little room for self exploration…

Top Labels in this Space