{"id":4045,"date":"2023-03-22T12:15:19","date_gmt":"2023-03-22T12:15:19","guid":{"rendered":"https:\/\/info.documotor.com\/?page_id=4045"},"modified":"2023-03-22T12:15:19","modified_gmt":"2023-03-22T12:15:19","slug":"multiply","status":"publish","type":"page","link":"https:\/\/info.documotor.com\/?page_id=4045","title":{"rendered":"Multiply"},"content":{"rendered":"\n<p>The multiply function can be used for the multiplication of 2 numbers<\/p>\n\n\n\n<h3>Syntax<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">number multiply(number $left, number $right)<\/code><\/pre>\n\n\n\n<p>Multiplies $right and $left. <\/p>\n\n\n\n<h3>Parameters<\/h3>\n\n\n\n<p><strong>$left:<\/strong> The first number.<br><strong>$right: <\/strong>The second number.<\/p>\n\n\n\n<h3>Example<\/h3>\n\n\n\n<p>Two key-value pairs, each containing a number value, can be multiplied with the multiply function. This is demonstrated in the example below. It is worth noting that while numbers formatted as strings (see &#8220;z&#8221; in the data below) are also supported by this function, number values are preferred. Using string values could lead to errors, in this case, thus it should be considered converting them into numbers using the to_number function.<\/p>\n\n\n\n<pre title=\"Data\" class=\"wp-block-code\"><code lang=\"json\" class=\"language-json line-numbers\">{\n    \"x\": 2.5,\n    \"y\": 4\n    \"z\": \"4\"  \/\/While this is a string value, it would give the same result as \"y\". Ideally, string values shouldn't be using in numerical functions.\n}<\/code><\/pre>\n\n\n\n<pre title=\"Transformation\" class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash line-numbers\">{\n    mult: multiply(x, y)\n}<\/code><\/pre>\n\n\n\n<pre title=\"Output\" class=\"wp-block-code\"><code lang=\"json\" class=\"language-json line-numbers\">{\n    \"mult\": 10\n}<\/code><\/pre>\n\n\n\n<h3>Notes<\/h3>\n\n\n\n<p><strong>Decimal separator<\/strong><\/p>\n\n\n\n<p>The decimal separator is a dot and not a comma as in some regions of the world. i.e. 5.8 rather than 5,8.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The multiply function can be used for the multiplication of 2 numbers Syntax Multiplies $right and $left. Parameters $left: The first number.$right: The second number. Example Two key-value pairs, each containing a number value, can be multiplied with the multiply function. This is demonstrated in the example below. It is worth noting that while numbers [&hellip;]<\/p>\n","protected":false},"author":14,"featured_media":0,"parent":271,"menu_order":121,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages\/4045"}],"collection":[{"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/users\/14"}],"replies":[{"embeddable":true,"href":"https:\/\/info.documotor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4045"}],"version-history":[{"count":8,"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages\/4045\/revisions"}],"predecessor-version":[{"id":4112,"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages\/4045\/revisions\/4112"}],"up":[{"embeddable":true,"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages\/271"}],"wp:attachment":[{"href":"https:\/\/info.documotor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4045"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}