• Resolved Lobsterdm

    (@lobsterdm)


    Hi,
    I’ve set up a calculator to work out the number of packs needed to cover a wall.
    I’m using the math.ceil operator with this equation

    Math.ceil( quantity_field_id_1 )

    So we want the number of meters to be the total but if the user enters e.g. 5.1 then the packs needed should be 6

    It works perfectly in Preview mode but on the live side it’s not working as expected. If the user enters 5.1 they get 5 packs. It only goes to 6 when the user enters 5.5 or above.

    It works perfectly in preview mode in the admin area though. So entering 5.1 and above results in 6 packs which is correct.

    I’ve checked that the cache is refreshed and have tested it’s showing the correct calculator on the live site so totally confused why it’s not working the same.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Hi,

    You have set Math.cell() into the Total field, that’s why it is displaying 6 in Total. You need to activate the “Round value to Whole” option in the settings of the Quantity field element settings -> https://prnt.sc/s3vskw

    regards

Viewing 1 replies (of 1 total)
  • The topic ‘Math.ceil not working on front end’ is closed to new replies.