WordPress.org

Forums

Calculated Fields Form
[resolved] Help with log() Formula (7 posts)

  1. Mystech
    Member
    Posted 1 year ago #

    Hi, love the plugin but my math is very rusty and the syntax on some formulas just isn't clicking for me. Any recommendations on how to:

    Convert Watts to dBm:
    dBm = 10log(Watts x 10^3)

    Thanks!

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

  2. codepeople
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    Suppose the Watts field is named fieldname1, so the equation would be:

    10*log(fieldname1*pow(10,3))

    Best regards.

  3. Mystech
    Member
    Posted 1 year ago #

    Thanks for the fast reply!

    Sadly, no luck with the formula provide. Other, simpler formulas work fine however. Other things I've checked:

    - Only one form per page
    - fieldname number correct

    Screenshot: http://i.imgur.com/Lu4H5kk.jpg

  4. codepeople
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    Could you send me the link to your page for checking the equation, please?

    If you prefer, use our support page:

    http://wordpress.dwbooster.com/support

  5. Mystech
    Member
    Posted 1 year ago #

    Here it is configured with the formula you provided above:
    http://spc.itswordpress.com/tools/pl-watts-dbm/

    Interesting, I can't get a plain log function by itself to work either:
    log(number)

    Tested in IE7/8/9, FF and Chrome.

  6. codepeople
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    The issue is very simple, our plugin assigns all methods of "Math" class, to the object "window", but the method "window.log" is defined in the javascript file http://spc.itswordpress.com/wp-content/themes/nexus/js/plugins.js

    In this case you should modify the equation like below, to avoid conflicts:

    10*Math.log(fieldname1*pow(10,3))

    Best regards.

  7. Mystech
    Member
    Posted 1 year ago #

    Brilliant! Thank you so much for your help!

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