{"id":4042,"date":"2023-03-22T12:23:06","date_gmt":"2023-03-22T12:23:06","guid":{"rendered":"https:\/\/info.documotor.com\/?page_id=4042"},"modified":"2023-03-22T12:23:06","modified_gmt":"2023-03-22T12:23:06","slug":"subtract","status":"publish","type":"page","link":"https:\/\/info.documotor.com\/?page_id=4042","title":{"rendered":"Subtract"},"content":{"rendered":"\n<p>Can be used to subtract two 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 subtract(number $left, number $right)<\/code><\/pre>\n\n\n\n<p>Subtracts $right from $left. <\/p>\n\n\n\n<h3>Parameters<\/h3>\n\n\n\n<p><strong>$left:<\/strong> The first number. Can be of type number (integer\/float) and string.<br><strong>$right: <\/strong>The second number. Can be of type number (integer\/float) and string.<\/p>\n\n\n\n<h3>Example<\/h3>\n\n\n\n<p>In the example below, two key-value pairs, each containing a number value, are used in combination with the subtract function.<\/p>\n\n\n\n<pre title=\"Data\" class=\"wp-block-code\"><code lang=\"json\" class=\"language-json line-numbers\">{\n    \"x\": 5,\n    \"y\": 3\n}<\/code><\/pre>\n\n\n\n<pre title=\"Transformation\" class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash line-numbers\">{\n    sub: subtract(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    \"sub\": 2\n}<\/code><\/pre>\n\n\n\n<h3>Notes<\/h3>\n\n\n\n<p><strong>Numbers vs. strings<\/strong><\/p>\n\n\n\n<p>Even though string parameters works, it is recommended to use numbers (integers or floats) since strings are more error prone.<\/p>\n\n\n\n<p><strong>Decimal separator in floats<\/strong><\/p>\n\n\n\n<p>The decimal separator in floats 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>Can be used to subtract two numbers. Syntax Subtracts $right from $left. Parameters $left: The first number. Can be of type number (integer\/float) and string.$right: The second number. Can be of type number (integer\/float) and string. Example In the example below, two key-value pairs, each containing a number value, are used in combination with the [&hellip;]<\/p>\n","protected":false},"author":14,"featured_media":0,"parent":271,"menu_order":187,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages\/4042"}],"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=4042"}],"version-history":[{"count":9,"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages\/4042\/revisions"}],"predecessor-version":[{"id":5354,"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages\/4042\/revisions\/5354"}],"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=4042"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}