• Resolved dasteralo2

    (@dasteralo2)


    Hello,
    Thank you for your great plugin.
    I need to calculate Total loam amount using :
    – Monthly payment
    – Rate
    – Number of months
    I’m a bit lost with the formula. can you please help me ?
    Thank you very much!

    *Edit
    I’ve just found that this is what i need:
    CALCULATEAMOUNT(x,y,z)
    How can i insert that function ?
    Thank you

    https://wordpress.org/plugins/calculated-fields-form/

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author codepeople

    (@codepeople)

    Hi,

    What version of the plugin are you using?

    The CALCULATEAMOUNT operation is part of the financial module included only with the Developer and Platinum versions of the plugin. If you are using one of these versions of the plugin, and the fields corresponding to the Monthly payments, rate and number of months are the fieldname1, fieldname2, and fieldname3 respectively, the equation associated to the calculated field would be as simple as:

    CALCULATEAMOUNT(fieldname1,fieldname2,fieldname3)

    Best regards.

    Thread Starter dasteralo2

    (@dasteralo2)

    Hello,
    Unfortunatly i only have the free version of the plugin and i just need that formula.
    So i think i won’t upgrade just for one formula but i understand your point of view.
    I will try to do my best to find the right formula by myself 😉
    Thank you

    Plugin Author codepeople

    (@codepeople)

    Hi,

    Our plugin allows to use all javascript instructions in the equations, the different modules, like: date/time, financial, distance, etc. facilitates the implementation of the equations, but if you have knowledge about the javascript programming language, you can implement your own operations.

    Best regards.

    Thread Starter dasteralo2

    (@dasteralo2)

    Thank you for your answer.
    I’m sorry i don’t really understand (because of my poor english 🙂
    Do you mean that i can insert javascript code directly into the “Set equation field” ?
    I have the javascript code for total amount but i don’t really understand how and where i have to insert it

    Plugin Author codepeople

    (@codepeople)

    Hi,

    Yes, you should select the calculated field, and enter the equation in the “Set Equation” textarea, for example, if your equation is as simple as the sum of two fields: fieldname1, and fieldname2 the equation would be:

    fieldname1+fieldname2

    however if the equation is complex, you should use the “function” structure:

    (function(){
    var result = fieldname1+fieldname2;
    return result;
    })()

    Tip: Remember to return a result that will be displayed as the calculated field value.

    Best regards.

    Thread Starter dasteralo2

    (@dasteralo2)

    I’ve tried to use this structure but i have no result

    (function(fieldname8, fieldname7, fieldname2){
    var result = 0;
    if(fieldname7 == 0){
    result = fieldname2 * fieldname8;
    }
    else{
    var i = ((fieldname7/100) / 12),
    i_to_m = Math.pow((i + 1), fieldname8),
    a = fieldname2 / ((i * i_to_m) / (i_to_m - 1));
    result = Math.round(a * 100) / 100;
    }
    return result;
    })()

    Do i forgot something ? Do i have to enter the script code in the “set equation field”?

    Plugin Author codepeople

    (@codepeople)

    Hi,

    You shouldn’t define parameters in the function:

    (function(){
    var result = 0;
    if(fieldname7 == 0){
    result = fieldname2 * fieldname8;
    }
    else{
    var i = fieldname7/100/12,
    i_to_m = POW(i + 1, fieldname8),
    a = fieldname2 / (i * i_to_m) / (i_to_m - 1));
    result = ROUND(a * 100) / 100;
    }
    return result;
    })()

    The structure now is correct, but from this support thread, I cannot check the values of the form’s fields.

    Best regards.

    Thread Starter dasteralo2

    (@dasteralo2)

    How can i change the field name ?
    I have two forms in the same page and i think there is a conflict with the fields names.
    fieldname7, fieldname8 and fieldname2 already exists in the first form.

    Plugin Author codepeople

    (@codepeople)

    Hi,

    The fields’ names are generated dynamically and cannot be modified, however, you can insert multiple forms in the same page, that won’t be conflict between their fields, each equation uses only the fields corresponding to its form.

    Could you send me the link to your webpage to check the form in action, please?

    Best regards.

    Thread Starter dasteralo2

    (@dasteralo2)

    Sure!
    Thank you very much for all your help

    http://caphornptf.cluster003.ovh.net/

    Plugin Author codepeople

    (@codepeople)

    Hi,

    There are some issues in your equation. Your current equation is:

    (function(){
    	var result = 0;
    	if(fieldname7_2 == 0){
    		result = fieldname2_2 * fieldname8_2;
    	}
    	else{
    		var i = fieldname7_2/100/12,
    		    i_to_m = POW(i + 1, fieldname8_2),
    		    a = fieldname2_2 / (i * i_to_m) / (i_to_m - 1));
    
    		result = ROUND(a * 100) / 100;
    	}
    	return result;
    })()

    Remove the _2 from the fields’ names, furthermore in the piece of code: a = fieldname2_2 / (i * i_to_m) / (i_to_m - 1)); there is an extra right parenthesis “)”

    The correct equation is:

    (function(){
    	var result = 0;
    	if(fieldname7 == 0){
    		result = fieldname2 * fieldname8;
    	}
    	else{
    		var i = fieldname7/100/12,
    		    i_to_m = POW(i + 1, fieldname8),
    		    a = fieldname2 / (i * i_to_m) / (i_to_m - 1);
    
    		result = ROUND(a * 100) / 100;
    	}
    	return result;
    })()

    If you need additional help to implement your equations, I can offer you a custom coding service through the following link:

    http://cff.dwbooster.com/customization

    Best regards.

    Thread Starter dasteralo2

    (@dasteralo2)

    Man you are a genius!!!! 🙂
    Thank you very much for all your help and support

    One last question. How can i have space between hundreds
    something like
    200 000 instead of 200000

    Plugin Author codepeople

    (@codepeople)

    Hi,

    Enter the space character into the “Prefix” attribute of the calculated field.

    Best regards.

    Thread Starter dasteralo2

    (@dasteralo2)

    Thank you very much!!!!

Viewing 14 replies - 1 through 14 (of 14 total)

The topic ‘Help for Total loam amount’ is closed to new replies.