<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/18857" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2012-02-29T12:54:17-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/18857</id>

		<entry>
		<author><name><![CDATA[Fire-Fox]]></name></author>
		<updated>2012-02-29T12:15:30-04:00</updated>

		<published>2012-02-29T12:15:30-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=98906#p98906</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=98906#p98906"/>
		<title type="html"><![CDATA[[SOLVED] Add Commas to a Number]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=98906#p98906"><![CDATA[
Thanks got i working <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8230">Fire-Fox</a> — Wed Feb 29, 2012 12:15 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2012-02-28T21:02:52-04:00</updated>

		<published>2012-02-28T21:02:52-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=98903#p98903</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=98903#p98903"/>
		<title type="html"><![CDATA[[SOLVED] Add Commas to a Number]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=98903#p98903"><![CDATA[
There is actually more to it than simply three digits and a comma. What appears to be the best all around answers was..<div class="codebox"><p>Code: </p><pre><code>proc commify number {regsub -all \\d(?=(\\d{3})+([regexp -inline {\.\d*$} $number]$)) $number {\0,}}</code></pre></div>set comma_number [commify "123456128213123412.1234"]<br><br>See here: <a href="http://wiki.tcl.tk/5000" class="postlink">http://wiki.tcl.tk/5000</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Tue Feb 28, 2012 9:02 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2012-02-28T18:33:07-04:00</updated>

		<published>2012-02-28T18:33:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=98902#p98902</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=98902#p98902"/>
		<title type="html"><![CDATA[[SOLVED] Add Commas to a Number]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=98902#p98902"><![CDATA[
I can't think of any packages that will do this for you right now, but then again, the procedure isn't that hard;<br>Pick out pieces of three digits, and insert the separator of your choice inbetween. The only tricky part is to decide whether the left-most block should be 1, 2, or 3 digits long - as this is determined by the length of the whole string.<br><br>Provided you are dealing with integer, the following should probably work:<div class="codebox"><p>Code: </p><pre><code>proc nFormat {string} {  set len [expr [string length $string] - 1]  set i [expr $len % 3]  set out [string range $string 0 $i]  while {$i &lt; $len} {    append out ",[string range $string [incr i] [incr i 2]]"  }  return $out}</code></pre></div>If you are dealing with floating-point values, you'd have to separate the decimal part of the value before iterating through the string.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Tue Feb 28, 2012 6:33 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Fire-Fox]]></name></author>
		<updated>2012-02-29T12:54:17-04:00</updated>

		<published>2012-02-28T14:06:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=98899#p98899</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=98899#p98899"/>
		<title type="html"><![CDATA[[SOLVED] Add Commas to a Number]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=98899#p98899"><![CDATA[
Hey!<br><br>How do i add commas to a database output so its more readable ? <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8230">Fire-Fox</a> — Tue Feb 28, 2012 2:06 pm</p><hr />
]]></content>
	</entry>
	</feed>
