{"id":1306,"date":"2026-01-12T14:55:45","date_gmt":"2026-01-12T14:55:45","guid":{"rendered":"https:\/\/monkey.ploogie.co.uk\/?page_id=1306"},"modified":"2026-01-12T14:55:45","modified_gmt":"2026-01-12T14:55:45","slug":"mwnci-trunc-function","status":"publish","type":"page","link":"https:\/\/monkey.ploogie.co.uk\/index.php\/mwnci-trunc-function\/","title":{"rendered":"Mwnci trunc() Function"},"content":{"rendered":"<h2>Syntax<\/h2>\n<p>trunc<strong>(<em>number<\/em>)<\/strong><\/p>\n<h2>Description<\/h2>\n<p>The <i>trunc()<\/i> function returns returns the truncated integer part of a number.<br \/>\nThis function will NOT round the number to the nearest integer, but simply removes the decimals.<br \/>\nA <em>float<\/em> value of the truncated integer is returned<\/p>\n<h2>Example<\/h2>\n<pre>include(\"math\")\r\nprintln(trunc(1.234))\r\nprintln(trunc(1))\r\nprintln(type(trunc(1.234)))\r\nprintln(type(trunc(1)))\r\n\r\n\r\n1\r\n1\r\nfloat\r\nfloat\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Syntax trunc(number) Description The trunc() function returns returns the truncated integer part of a number. This function will NOT round the number to the nearest integer, but simply removes the decimals. A float value of the truncated integer is returned Example include(&#8220;math&#8221;) println(trunc(1.234)) println(trunc(1)) println(type(trunc(1.234))) println(type(trunc(1))) 1 1 float float<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1306","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/1306","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/comments?post=1306"}],"version-history":[{"count":1,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/1306\/revisions"}],"predecessor-version":[{"id":1307,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/1306\/revisions\/1307"}],"wp:attachment":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/media?parent=1306"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}