Number type inference leading to undesired rounding

I noticed an odd behavior which I feel is a bug (I can’t think of a good use case for this). The Sum() function (as well as the add operator a.k.a. the + sign, and probably other math functions?) seems to infer the numeric type from the first operand of the list of values to sum. Thus if the first operand is an integer, the output of the entire operation seems to become an integer, even if the second operand is a decimal value. Thus an equation of “120 + 28.25” which should come out to “148.25” is instead shown as “148” with the decimal portion truncated or rounded.

What’s even more odd is that at one point when I moused-over the “148”, the tooltip value was correct, i.e. “148.25”. So I know the value is used internally, but the display is influenced by which operand was first in the equation or Sum() function.

What do the Coda engineers think? I attached a small .GIF showing the problem in my Doc below:


Of course as I look at this further, the waters get muddier… A simple equation in a formula on the canvas doesn’t seem to have this same outcome. It seems as though the issue relates to my use of WithName() for the two values in my example (WagonSalesPaidQty and SnSQty).