AnsweredAssumed Answered

Arithmetic with decimals/floats?

Question asked by L.Elias Champion on Sep 3, 2014
Latest reply on Jan 31, 2017 by BenRi

I'm sure I'm just missing something extraordinarily obvious here but I can't get this to work. I have a GEL script that is querying the DB for some values to do some calculations. The data is stored in Clarity as a Number with 2 decimal places. It pulls and displays the numbers as I would expect, but it seems to be treating them as whole integers for the math

 

<gel:log level="INFO" category="LOOP" var="include_log">Value ${t_weight} + ${t_value} = ${t_weight+t_value}</gel:log>

 

Leaves me with

[LOOP]Value 1.50 + 3 = 4

I also tried

<core:expr value="${t_weight + t_value}"/>

 

but got the same result. Multiplication does the same thing, giving stuff like 0.75 * 3 = 0

 

What am I missing here?

Outcomes