• Hi,

    Is it possible to use trans to work out an addition or subtraction?

    I can use bcmul and bcdiv to display multiplications and divisions of numbers entered into CF7, but bc add and bcsub don’t seem to do anything.

    For example, this works fine –> [cfdb-value filter=”Submitted Login=$user_login” form=”Assessments” orderby=”Date desc” limit=”1″ show=”Cals” trans=”Cals=bcmul(Weight,33.21,0)”]

    But this doesn’t –> [cfdb-value filter=”Submitted Login=$user_login” form=”Assessments” orderby=”Date desc” limit=”1″ show=”Name” trans=”Name=bcsub(Weight,10,0)”]

    Any help would be greatly appreciated 🙂

    Thanks,

    Jon

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Michael Simpson

    (@msimpson)

    Try sum(Weight,10) or diff(Weight,10)

    A number with a comma in it such as 10,0 will be seen as 2 arguments

    Thread Starter joncwhall

    (@joncwhall)

    That’s awesome – thank you very much 🙂

    Jon

    Thread Starter joncwhall

    (@joncwhall)

    Hi Michael,

    I’ve just noticed this formula on my page has stopped working. It’s not changed and I’ve tried rebuilding it from scratch and it doesn’t help.

    Everything except the diff bit is ok – has that been discontinued as a function by any chance? It works fine with sum in there, just not diff.

    Thanks,

    Jon

    Thread Starter joncwhall

    (@joncwhall)

    Hi Michael,

    I managed to get it working last time by using the sum function a negative number. This has stopped working now (and diff still doesn’t) if you have any thoughts?

    And example of the formula I’m using is:

    [cfdb-value filter=”Submitted Login=$user_login” form=”Assessments” orderby=”Date desc” limit=”1″ show=”One” trans=”Maintain=bcmul(Weight,33.21,0)&&Cals=sum(Maintain,-500)&&One=bcmul(Cals,0.083333333,0)”]

    Thanks,

    Jon

    i like to multiply area in sq meter and price per sq meter like =(area in sq meter)*(price per sq meter) , and display it in page & also have to convert area in sq meter to area in sq feet by using formula like =(area in sq meter)*10.7639
    please help …..
    Thanks

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

The topic ‘Adding or subtracting with trans in shortcode’ is closed to new replies.