<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><DIV>That should probably be</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">    </SPAN>"%.#{ENV['TM_CALC_PREC'] || 3}g" % self</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>the g instead of f will allow for exponential notation.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>If you want 2/3 to do float division, try</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>class Fixnum</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">  </SPAN>def /(n)</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">             </SPAN>self.to_f / n</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>end</DIV><DIV>end</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>That won't affect Bignums, but then again, converting a Bignum to a float could easily lose precision.</DIV><BR><DIV><DIV>On Dec 7, 2006, at 10:22 PM, Charilaos Skiadas wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">Ok, here is the best I can do for now, with Eridius's help: Create a textmate command that has input "Selected Text or Line", and output: "Replace Selected Text". The text of the command should be the following 8 lines:</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">#!/usr/bin/env ruby</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">include Math</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">class Float</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica"><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>def inspect</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica"><SPAN class="Apple-tab-span" style="white-space:pre">   </SPAN><SPAN class="Apple-tab-span" style="white-space:pre">    </SPAN>"%.#{ENV['TM_CALC_PREC'] || 3}f" % self</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica"><SPAN class="Apple-tab-span" style="white-space:pre">     </SPAN>end</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">end</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">print(eval(STDIN.read).inspect)</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">this should be improved, but it is a start. It will not do integer division properly unless you coerce it:</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">2/3=0, 2.0/3=0.667</FONT></P> </BLOCKQUOTE></DIV><BR><DIV> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV>-- </DIV><DIV>Kevin Ballard</DIV><DIV><A href="http://kevin.sb.org">http://kevin.sb.org</A></DIV><DIV><A href="mailto:kevin@sb.org">kevin@sb.org</A></DIV><DIV><A href="http://www.tildesoft.com">http://www.tildesoft.com</A></DIV><BR class="Apple-interchange-newline"></SPAN> </DIV><BR></BODY></HTML>