{"id":19033819,"date":"2026-10-01T08:42:13","date_gmt":"2026-10-01T08:42:13","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/function-round-not-working-with-brackets\/"},"modified":"2026-10-01T08:52:00","modified_gmt":"2026-10-01T08:52:00","slug":"function-round-not-working-with-brackets","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/function-round-not-working-with-brackets\/","title":{"rendered":"Function ROUND() not working with brackets"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Hi,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">thanks for the plugin.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I have to round an expression and I have observed that the ROUND() function does not like additional brackets and gives an error <code>SyntaxError: missing ) in parenthetical<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Say, I want to round <code>(var1+1)\/(var2+1)<\/code>, where <code>var1<\/code> and <code>var2<\/code>are numbers.<br \/>I would expect the code to be <code>ROUND((var1+1)\/(var2+1))<\/code>. But it does not work, giving the above error message.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>((var1+1)\/(var2+1))<\/code> does work and gives the (unrounded) result.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Similarly <code>((var-1.234))<\/code> or <code>((var-1.234)\/2)<\/code> or <code>round(var-1.234\/2)<\/code> work (with different results ofc), but <code>round((var-1.234)\/2)<\/code> does not.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Any help greatly appreciated. Cheers.<\/p>\n","protected":false},"template":"","class_list":["post-19033819","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19033819","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":1,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19033819\/revisions"}],"predecessor-version":[{"id":19033824,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19033819\/revisions\/19033824"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=19033819"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}