{"id":466,"date":"2013-03-05T12:28:42","date_gmt":"2013-03-05T17:28:42","guid":{"rendered":"http:\/\/www.cfchimp.com\/wordpress\/?p=466"},"modified":"2024-12-05T20:09:21","modified_gmt":"2024-12-06T01:09:21","slug":"coldfusion-function-returns-space-before-value","status":"publish","type":"post","link":"https:\/\/csimmons.dev\/blog\/2013\/03\/coldfusion-function-returns-space-before-value\/","title":{"rendered":"ColdFusion function returns space before value"},"content":{"rendered":"<p>I had an annoying issue this morning where a function I wrote that rounds and formats values for use in an internal financial app kept sticking a single space before the value returned.  This was obviously not good for a financial app.  After spending 10-15 minutes tearing the function&#8217;s innards apart it turns out what was going on in the function was not the cause.  The cause was simple.<\/p>\n<p>In a tag based ColdFusion function you need to be sure to include the &#8216;output=&#8221;no&#8221;&#8216; attribute.<\/p>\n<pre class=\"prettyprint\">\r\n<cffunction name=\"RoundMoney\" returntype=\"numeric\" output=\"no\"> \r\n     ... MAGIC STUFF HERE ...\r\n<\/cffunction>\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I had an annoying issue this morning where a function I wrote that rounds and formats values for use in an internal financial app kept sticking a single space before the value returned. This was obviously not good for a financial app. After spending 10-15 minutes tearing the function&#8217;s innards apart it turns out what &#8230; <a title=\"ColdFusion function returns space before value\" class=\"read-more\" href=\"https:\/\/csimmons.dev\/blog\/2013\/03\/coldfusion-function-returns-space-before-value\/\" aria-label=\"Read more about ColdFusion function returns space before value\">Read more<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"_cloudinary_featured_overwrite":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[68],"tags":[48,12],"class_list":["post-466","post","type-post","status-publish","format-standard","hentry","category-developer","tag-coldfusion","tag-developer"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pbVg43-7w","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/posts\/466","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/comments?post=466"}],"version-history":[{"count":0,"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/posts\/466\/revisions"}],"wp:attachment":[{"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/media?parent=466"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/categories?post=466"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/tags?post=466"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}