Page 1 of 1

Condition on calculated field

Posted: 19 Nov 2019
by Katy
I have a simple condition on calculated field value (stored as number), but it is not working (i've read this already):

Code: Select all

function setapproval() {
var calcValue = parseFloat(fd.field('ConvertedTotal').control()._el().text()); 
if (calcValue > 5000) {
    alert(calcValue);
  } 
}
setapproval();
The calculated field is number, but i already tried to make it text - nothing. The code is on Display form. I've tried to store the calculated field as text - didn't help.
Please help!

Re: Condition on calculated field

Posted: 19 Nov 2019
by Katy
update: i figured out the reason: because the calculated number is XXXX it shows as x,xxx so the system recognize only the part before coma,
40,450 is only recognized as 40 so it is less then 5000... how i can go around that? the numbers would 99,9% by higher then 5000, so how i can ignore those comas after thousands?

Re: Condition on calculated field

Posted: 19 Nov 2019
by Katy
Update: I found the solution!))
I wrapped my calculation into this:

=text([NumberColumn],"0.00")

and it works as a clock!) :D