• Resolved Michael

    (@taloscent)


    Hello,
    Based on some previous guidance you gave me I am trying to do the following:
    cell1: [registrationfee] (This is a shortcode)
    cell2: 128.00
    cell3: =[tuitionrate]*8.00
    cell4: =${NUMBER_FORMAT( SUM(B2:B4), 2 )}
    cell5: =${NUMBER_FORMAT( SUM(B2:B4)-B4, 2 )}

    Problem: cell 3 will not show two decimal places even though I have .00 in there.
    Problem: I would like cell 1-3 to also show $. If I use a $ in the shortcode it breaks and if I try to use a $ in cell 2 and 3 it breaks.

    Any ideas?
    Thanks

    https://www.ads-software.com/plugins/tablepress/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks for your question, and sorry for the trouble.

    The reason for the problem in table 3 is the same as in the previous thread. You’ll have to wrap that in the NUMBER_FORMAT function.

    Then, to add the $ to cells 1 and 3 as well:
    The trick here is to create separate cells for the mathematical calculation and the display and formatting.
    To do this, just add another column to the right of the current one and hide the original column (via the “Selected columns: Hide” button).
    Then, in the hidden column, add the formulas without any formatting, i.e. without the $ and the NUMBER_FORMAT.
    In the second column (which will be used for display), you’ll then just have to use formulas like

    =${NUMBER_FORMAT( A2, 2 )}

    to reference the calculated value from the cell on its left and format it.

    Regards,
    Tobias

    Thread Starter Michael

    (@taloscent)

    Ah yes! I missed that. Thanks for the clarification. Good solution.

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    no problem, you are very welcome! ?? Good to hear that this will help!

    Best wishes,
    Tobias

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Decimal Places’ is closed to new replies.