<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Simian Enterprises &#187; CFKrypton</title>
	<atom:link href="https://www.simianenterprises.co.uk/blog/category/cfkrypton/feed" rel="self" type="application/rss+xml" />
	<link>https://www.simianenterprises.co.uk/blog</link>
	<description>Web development, Coldfusion, CSS, a bit of this, a bit of that...</description>
	<lastBuildDate>Sat, 26 Apr 2014 00:42:55 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.2.7</generator>
	<item>
		<title>Find the closest in a list of numbers</title>
		<link>https://www.simianenterprises.co.uk/blog/find-the-closest-in-a-list-of-numbers-189.html</link>
		<comments>https://www.simianenterprises.co.uk/blog/find-the-closest-in-a-list-of-numbers-189.html#comments</comments>
		<pubDate>Sat, 26 Apr 2014 00:27:54 +0000</pubDate>
		<dc:creator><![CDATA[Gary]]></dc:creator>
				<category><![CDATA[CFKrypton]]></category>
		<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Railo]]></category>

		<guid isPermaLink="false">http://www.simianenterprises.co.uk/blog/?p=189</guid>
		<description><![CDATA[For a while now I&#8217;ve been working on a core set of functionality that I include with every application. In fact, my applications extend a core app that contains a whole bunch of commonly used functionality &#8211; but that&#8217;s a whole other post. I&#8217;d intended to blog about some of the components I&#8217;ve been writing [&#8230;]<div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="https://www.simianenterprises.co.uk/blog/integrate-wordpress-into-your-coldfusion-app-148.html" rel="bookmark" title="Integrate WordPress into your ColdFusion app">Integrate WordPress into your ColdFusion app </a> <small>Integrate a Wordpress blog into your CFML app, with functions...</small></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>For a while now I&#8217;ve been working on a core set of functionality that I include with every application. In fact, my applications <em>extend</em> a core app that contains a whole bunch of commonly used functionality &#8211; but that&#8217;s a whole other post.</p>
<p>I&#8217;d intended to blog about some of the components I&#8217;ve been writing as I go along, but as is so often the case I find myself moving onto new work before I&#8217;ve sat down to write about the last.</p>
<p>Today, I needed to pass a number to a function and return the closest number in a given list.<br />
So for example, a list of <strong>&#8216;10,20,50,100,200,1000&#8217;</strong> and a value of <strong>42</strong>, should return <strong>50.</strong></p>
<p>It&#8217;s a simple requirement, but Google returned nothing &amp; the mighty Ben Nadel hadn&#8217;t written a comprehensive post on how to do it along with speed tests and examples involving hot girls; so I wrote a function and added it to my ever increasing library.</p>
<p>As it&#8217;s small, I thought I&#8217;d share&#8230; in doing so, I realised I&#8217;ve not updated this site in <em>way</em> too long &#8211; so for this I apologise.</p>
<p>Here&#8217;s what I came up with &#8211; hopefully it&#8217;ll save someone a bit of time:</p>
<div class="oembed-gist"><script src="https://gist.github.com/GaryStanton/f2371ad529756c1f79a3.js"></script><noscript>View the code on <a href="https://gist.github.com/GaryStanton/f2371ad529756c1f79a3">Gist</a>.</noscript></div>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="https://www.simianenterprises.co.uk/blog/integrate-wordpress-into-your-coldfusion-app-148.html" rel="bookmark" title="Integrate WordPress into your ColdFusion app">Integrate WordPress into your ColdFusion app </a> <small>Integrate a Wordpress blog into your CFML app, with functions...</small></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>https://www.simianenterprises.co.uk/blog/find-the-closest-in-a-list-of-numbers-189.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
