<?xml version="1.0" encoding="windows-1252"?>
<node id="86945" title="Ah, but what about correct display of the decimal point?" created="2001-06-08 15:35:07" updated="2005-07-19 14:08:39">
<type id="11">
note</type>
<author id="86555">
mugwumpjism</author>
<data>
<field name="doctext">
&lt;p&gt;Whilst my answer is longer, I think you will find it simulates a 7 segment display a little closer, and it has a larger, more readable font.&lt;/p&gt;

&lt;p&gt;This one weighs in at 299 characters, excluding line breaks.&lt;/p&gt;

&lt;code&gt;sub f{
$i=$_[0];$i=~s/(\d)\./$1|'@'/eg;@c=split//,"\brew\$]m.k{%\177o";
for$a(0..8){for$l(split//,$i){$x=ord$c[ord($l&amp;"?")-45];print do{
if($a%4){$q=($x&gt;&gt;($a&gt;4)*3)&amp;6;($q&amp;2?"|":" ")."     ".($q&amp;4?"|":" ")
."   ";}else{($x&gt;&gt;($a&gt;&gt;2)*3&amp;1?" ----- ":" "x7).
($a==8&amp;&amp;(($l&amp;"@")eq"@")?" X ":"   ");}}}print"\n";}}

f(-123.04);
f(56789);&lt;/code&gt;

&lt;p&gt;And the output is:&lt;/p&gt;

&lt;pre&gt;
                     -----     -----              
                |         |         |   |     |   
                |         |         |   |     |   
                |         |         |   |     |   
 -----               -----     -----     -----    
                |   |               |         |   
                |   |               |         |   
                |   |               |         |   
                     -----     -----  X           
 -----     -----     -----     -----     -----     -----    
|         |               |   |     |   |     |   |     |   
|         |               |   |     |   |     |   |     |   
|         |               |   |     |   |     |   |     |   
 -----     -----               -----     -----              
      |   |     |         |   |     |         |   |     |   
      |   |     |         |   |     |         |   |     |   
      |   |     |         |   |     |         |   |     |   
 -----     -----               -----     -----     -----    
&lt;/pre&gt;

&lt;p&gt;Not bad for a first golf attempt?  :-)&lt;/p&gt;</field>
<field name="root_node">
86805</field>
<field name="parent_node">
86805</field>
</data>
</node>
