Connecting two codes to work together

Avatar

Avatar

NY2CA

Avatar

NY2CA

NY2CA

05-11-2012

I am trying to connect the following codes to work together. The way it's constructed one code will work but not the other, this is also true when the code is reversed. The 1st part of the code represents a change in the percentage and the 2nd part of the code calculates the actual percentage.

The percentage is formatted as "00.00% When it exceeds 80.00%, I need it to change color and the same for over 90.00%

if (LTV1st > 80)then

LTV1st.fillColor = "239,122,242"

elseif ($ > 90) then

LTV1st.fillColor = "110,0,0"

else LTV1st.fillColor = "208,208,208"

endif

If(FirstLien>0 and SalesPrice>0) then LTV1st = FirstLien / SalesPrice;

endif

Both are under the formcalc, calculate event.

Thanks.

View Entire Topic

Avatar

Avatar

NY2CA

Avatar

NY2CA

NY2CA

08-11-2012

You changed the code to:

var LVT = (100 / SalesPrice) * FirstLien.

By adding 100, you solved my problem, thank you. Because another code uses this code it no longer functions. Where can I insert the 100 into the following code?

if(rate1>0 and FirstLien>0 and rate2>=0 and Second>=0 and SalesPrice>0 and LTV1st>=0 and LTV2nd>=0) then Blendrate = (rate1 * FirstLien + rate2 * Second) / SalesPrice / (LTV1st + LTV2nd) ;

endif

Thank you.