{"id":157207,"date":"2022-06-06T08:33:04","date_gmt":"2022-06-06T08:33:04","guid":{"rendered":"\/knowledge\/forums\/topic\/how-to-round-the-value-of-an-expression-to-a-specified-decimal-value-2\/"},"modified":"2022-06-06T08:33:04","modified_gmt":"2022-06-06T08:33:04","slug":"how-to-round-the-value-of-an-expression-to-a-specified-decimal-value-2","status":"publish","type":"topic","link":"https:\/\/innovationspace.ansys.com\/knowledge\/forums\/topic\/how-to-round-the-value-of-an-expression-to-a-specified-decimal-value-2\/","title":{"rendered":"How to round the value of an expression to a specified decimal value"},"content":{"rendered":"<p>The value of an expression can be rounded to a specified decimal value by using the mod() function. This is shown below where the arbitrary expression TestValue is rounded to four decimal places using the expression RoundTestValue. Note that the expression RoundTestValue will need to be modified when rounding an expression with units. <br \/> LIBRARY: CEL: EXPRESSIONS: DecimalValue = 0.0001 RoundTestValue = TestValue +DecimalValue\/2 &#8211; mod(TestValue+DecimalValue\/2, DecimalValue) TestValue = 1.12445745 END END END<\/p>\n","protected":false},"template":"","class_list":["post-157207","topic","type-topic","status-publish","hentry","topic-tag-ansys-cfx","topic-tag-expressions"],"aioseo_notices":[],"acf":[],"custom_fields":[{"0":{"_wp_page_template":["default"],"_bbp_last_active_time":["06-06-2022 20:20"],"_bbp_forum_id":["27796"],"_btv_view_count":["1101"],"_bbp_likes_count":["0"],"_edit_lock":["1704986816:2"]},"test":"articlesansys-com"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/topics\/157207","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/topics"}],"about":[{"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/topics\/157207\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/media?parent=157207"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}