{"id":3334,"date":"2022-10-11T11:22:23","date_gmt":"2022-10-11T11:22:23","guid":{"rendered":"https:\/\/info.documotor.com\/?page_id=3334"},"modified":"2023-02-03T08:35:53","modified_gmt":"2023-02-03T08:35:53","slug":"add","status":"publish","type":"page","link":"https:\/\/info.documotor.com\/?page_id=3334","title":{"rendered":"Add"},"content":{"rendered":"\n<p>The simple function to add 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 add(number $left, number $right)<\/code><\/pre>\n\n\n\n<p>Adds two comma-separated numbers &#8211; not strings.<\/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<pre title=\"Data\" class=\"wp-block-code\"><code lang=\"json\" class=\"language-json line-numbers\">{\n    \"x\": 2,\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    sum: add(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    \"sum\": 5\n}<\/code><\/pre>\n\n\n\n<p>In this example, the keys &#8220;x&#8221; and &#8220;y&#8221; are added to form a new key &#8220;sum&#8221;. Notice that the values of the keys are all numbers.<\/p>\n\n\n\n<h3>Notes<\/h3>\n\n\n\n<p><strong>Decimal separator<\/strong><\/p>\n\n\n\n<p>Decimal separator is a dot, and not a comma as in some regions of the world. i.e. &#8220;5.8&#8221; rather than &#8220;5,8&#8221;.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The simple function to add two numbers. Syntax Adds two comma-separated numbers &#8211; not strings. Parameters $left: The first number.$right: The second number. Example In this example, the keys &#8220;x&#8221; and &#8220;y&#8221; are added to form a new key &#8220;sum&#8221;. Notice that the values of the keys are all numbers. Notes Decimal separator Decimal separator [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"parent":271,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages\/3334"}],"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\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/info.documotor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3334"}],"version-history":[{"count":4,"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages\/3334\/revisions"}],"predecessor-version":[{"id":4909,"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages\/3334\/revisions\/4909"}],"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=3334"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}