Simple Math in Calc element not working

jmoises

Active Member
Hello i have this simple code in a calc element and i dont get any results testing on a List any ideas?

Code:
 $aa = 100;
$bb = 20;
$cc =  $aa / $bb;
return $cc;


47423c25622a60fc6b119ee07c0eb60c.png

https://gyazo.com/47423c25622a60fc6b119ee07c0eb60c
 
I have not been able to get calc elements to show in list view for months.
If I put a calc element in the list it is always blank. (I'm sure I posted about this months ago)
But I just added a new calc in my test list with your code (cut and pasted) - and it is there - in the form and details view anyhow. (In the list the column header is there - but it is blank)
 
i manage to make it work like this

Code:
       $aa = (int)$a;
        $bb = (int)$b;
        $cc = $aa / $bb;
        $cc *= 100;
        $cc = round($cc,2);
        //var_dump($cc);exit;
        return (string)$cc;
 
That's good news (but weird). So I'm curious... Does it show in list view if you include it there?
 
Duhh - It's been a long day. I just realized it won't show until the form is saved. But what was strange about that is that it now shows in all the records in the list - after I saved it in just one. Also weird that you couldn't get it working with the original code - yet it worked for me.:confused:
 
Got a form I can look at?

Afaik, the calc element is working fine. I was doing some stuff with it today.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top