• Resolved Strawberry

    (@cheesecake4488)


    I have 2 cells

    The shortcode in cell A1 is as below. It display a value from live data.

    $[ign_metal_price_ajax metal=”copper” weight_unit=”grams” weight=”1000″ purity=”.9999″ markup1=”10″ markup2=”0″]

    I put B1 = A2 into cell B1 but there is an error message saying it is not an expression or number.

    Pls help. thank you.

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

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    The problem is the $ here. It basically turns the cell into text, which formulas can’t handle.
    The best solution should be to separate calculations and presentation here, e.g. by adding extra columns (that are hidden from the visitor with CSS code), in which the pure numeric calculations happen, and then formulas like

    =${B2}
    

    to show a calculated value with text (the $ in this example) around it.

    Regards,
    Tobias

    Thread Starter Strawberry

    (@cheesecake4488)

    Thank you. I have another question coming from the above. I put the following formula into a cell and the error message came out again. What is wrong? Please help. Thank you.

    = [ign_metal_price_ajax metal=”copper” weight_unit=”grams” weight=”1000″ purity=”.9999″ markup1=”10″ markup2=”0″]/2

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    ah, I forgot one thing: You will have to instruct TablePress to evaluate Shortcodes first, and then formulas.
    For this, you can use the TablePress Extension from https://tablepress.org/extensions/shortcodes-before-formulas/ which will essentially reverse the execution order of formulas and Shortcodes.
    To use it, extend the Shortcode that you are using to display the table to

    [table id=123 shortcodes_before_formulas=true /]
    

    Regards,
    Tobias

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

The topic ‘Showing numbers in shortcode’ is closed to new replies.