Support » Plugin: Calculated Fields Form » NUMBERFORMAT Breaking Form

  • Resolved ibanezjerk

    (@ibanezjerk)


    Using “NUMBERFORMAT(fieldname1, ‘USD’)” in the equations field breaks it so that the output doesn’t work anymore. Is that the correct way to use this? Full Equation:

    (function(){
    var result = fieldname10 + ” ” + fieldname11 + ” ” + fieldname12 + ” ” + fieldname13 + “. ” + “Stock # ” + fieldname3 + ” MSRP $” + fieldname6 + “; Sale price: $” + fieldname14 + “. Rebates: ” + fieldname7 + “. Down Payment: $” + FORMATNUMBER(fieldname15, ‘USD’) + “. Dealer retains all rebates. On approved credit. All prices plus tax, title, license, fees, and $299 dealer doc fee. Offer ends: ” + CDATE(fieldname8,’mm-dd-yyyy’) + “.”;
    jQuery(‘.equation-result’).html(result);
    return result;
    })()

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

    (@codepeople)

    Hello @ibanezjerk,

    The operation’s name is NUMBERFORMAT, and not FORMATNUMBER, more information in the following link:

    http://cff.dwbooster.com/documentation#financial-module

    Furthermore, remember that the NUMBERFORMAT operation is included in the “Financial Module” distributed with the “Developer” and “Platinum” versions of the plugin.

    Best regards.

    ibanezjerk

    (@ibanezjerk)

    Okay, is there, then, a way to format numbers that are in the calculations field that includes comma separators for thousands?

    Plugin Author codepeople

    (@codepeople)

    Hello @ibanezjerk,

    If you want to use an operation to format a number as part of the equation, and not as the final result of the equation, the NUMBERFORMAT would be the winner operation. However, if you are using the free version of the plugin, you can use an alternative. The piece of code:

    fbuilderjQuery.fbuilder.calculator.format(PREC(1230.123,2), {prefix: '$', groupingsymbol: ',', decimalsymbol: '.'})

    returns: $1,230.12

    Now you should replace the number with the field’s name, and integrate the previous piece of code in your equation.

    Best regards.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.