Calculated Fields Form
[resolved] Changing the rounding off function (4 posts)

  1. Dean
    Posted 2 years ago #

    the contact form enables one to round off but what if i wanted to set my own rounding off parameter.
    this are the current conditions
    If the value of the passed parameter is greater than or equal to x.5, the returned value is x+1; otherwise the returned value is x.

    what if i wanted for instance, if the value is 2680 it rounds it off to 2700. if its 2630 it rounds it off to 2650.


  2. codepeople
    Plugin Author

    Posted 2 years ago #


    In this case the equation will be a little more complex that usual. For example, suppose that original equation is fieldname1+fieldname2, if you want to use an uncommon operation for rounding the result, you should transform the previous equation like follow:

    var r = fieldname1+fieldname2;

    if(r == 2680) r = 2700;
    if(r == 2630) r = 2650;

    return r;

  3. Dean
    Posted 2 years ago #

    so i should insert all that where? in the equation field? and i want it to do that for every value that is calculated. is it possible?
    thank you for your prompt response.

  4. codepeople
    Plugin Author

    Posted 2 years ago #


    The demo in the previous entry, should be entered in the equation field. But pay attention, it is only a demo to demonstrate how to define a equation more complex.

    You may create complex equations in all Calculated Fields.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Calculated Fields Form
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic