New Bug Encountered: Percent value in VC changes to 0.00% after a Sync

This issue was originally noticed back in July but was not reported as a bug.

The problem seems to stem from defining a VC Percent type column when the values used in the calc the value are of Number type.

VC Percent column = Number1 / Number2

When entering or editing a row, the VC column calculates the value correctly. Once saved and a Sync is performed, The VC column reverts to 0.00%.

Editing row and immediately after Save, Percentage Value is correct.

After Sync, the Percent value reverts to 0.00%

1 Like

Thanks for Reporting John!

What you’re seeing is the difference between integer division and regular division. At minimum, it’s a bug that you’re seeing two different results from the same expression.

The best workaround is to ensure that one of the division operands is a Decimal rather than a Number. The idiomatic way to do this would be [Number1] * 1.0 / [Number2].

1 Like

@Steve_Howard I agree 100% its integer division and I posted the exact same workaround in the post that re-discovered the bug.

You can also resolve by defining the numbers as Decimal with ZERO decimal digits.

And yes, the main issue is that you see two different results at different times - client calculation versus server calculation.

But also, If I may be so bold to say so, the server should “know” what data type the result is being stored in and adjust the calculation according with the most prominent intent - especially in a no/low code environment.

1 Like