Form Calculation Widget - Formatting for currency with commas

  • lritter
    Asked on September 18, 2018 at 5:42 PM

    Hello!

    In the following screen shot, I set up a group of Form Calculation Widget (not sure this is the best option). Anyways, they seem to work, except the values circled in red do not show the currency symbol or a comma separating the numbers, e.g., $32,850.

    Also, is there a way to add the word 'days' after the calculation of Total Rental Days so the results look like: "131 days"?

    Thank you!


    1537306716screen shot4 Screenshot 10

  • Kevin Support Team Lead
    Replied on September 18, 2018 at 7:09 PM

    I have checked your form and I can see the widgets circled in red have a fixed value, upon checking your form I can see the elements have the dollar sign: 

    1537311451screenshot 01 Screenshot 10

    If you want to format the amount in "Total Rental Fee" then you may use the comma separate function, you will find more information about math functions on the calculation widget here: https://www.jotform.com/help/267-Form-Calculation-Math-Function-Reference 

    Regarding the second question, you may try with this CSS code: 

    div#cid_141:after {

        content: "Days";

    }

    Guide: https://www.jotform.com/help/117-How-to-Inject-Custom-CSS-Codes 

    The result can be seen on this sample form:  https://form.jotform.com/82607553952968 

    I hope this helps. 

  • lritter
    Replied on September 19, 2018 at 11:07 AM

    Hi Kevin_G!

    Ok, I was able to get the formatting I want. However, is there something wrong with JotForm's website? Almost, everytime I would click 'save' in the Form Calculation Widget, it would force me out and make me log back in, which means my changes were not saved. So, making the adjustments took 3x's as long because of this. Then, I finally got this to look at act as I wanted. I walked away to a meeting, came back and reviewed the form again in Preview to confirm and two of the fields are not working right again. See arrows below. This shows the form in preview mode. Notice Total Rental Rate and Total Rental Fee are not adding up. 

    1537369509screen shot5 Screenshot 10

    Here are the setting for Total Rental Rate. It looks correct...doesn't it???

    1537369595screen shot6 Screenshot 21

    Puzzled...


  • Kevin Support Team Lead
    Replied on September 19, 2018 at 12:34 PM

    I have cloned your form and I cannot replicate the issue about being logged out each time I edit the calculation widget. I can also see the calculation is not performing since you have added the dollar sign as numeric value when it should be a string, simply click on it to convert it to string and it should work: 

    1537374858screenshot 01 Screenshot 10

    Here's my cloned form where I did that change and it worked: https://form.jotform.co/82614854342862 

    Thanks. 

  • lritter
    Replied on September 19, 2018 at 2:58 PM

    Awesome! Thank you Kevin_G!