<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1250">


<META content="MSHTML 6.00.2900.2180" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=343391512-18012007><FONT face=Arial 
color=#0000ff size=2>Thanks at lot. Something as simple as 
that...</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=343391512-18012007><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=343391512-18012007><FONT face=Arial 
color=#0000ff size=2>J</FONT></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Geoframer [mailto:geoframer@gmail.com] 
<BR><B>Sent:</B> 18 January 2007 02:10 PM<BR><B>To:</B> Johan 
Geldenhuys<BR><B>Cc:</B> tutor@python.org<BR><B>Subject:</B> Re: [Tutor] 
Division doesn't work<BR></FONT><BR></DIV>
<DIV></DIV>You assign s as an integer... it should be a float to get the right 
result...<BR><BR>So either define s as <BR><BR>s = 14105.0<BR><BR>or as<BR><BR>s 
= float(14105)<BR><BR>it'll then result in the right answer :<BR><BR>In [17]: 
s=14105.0<BR>In [18]: s/1024<BR>Out[18]: 13.7744140625<BR><BR>In [19]: s = 
float(14105)<BR>In [20]: s/1024<BR>Out[20]: 13.7744140625<BR><BR>HTH - 
Geofram<BR><BR>
<DIV><SPAN class=gmail_quote>On 1/18/07, <B class=gmail_sendername>Johan 
Geldenhuys</B> &lt;<A 
href="mailto:johan@accesstel.co.za">johan@accesstel.co.za</A>&gt; wrote:</SPAN>
<BLOCKQUOTE class=gmail_quote 
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
  <DIV>
  <DIV><SPAN><FONT face=Arial size=2>Hi all,</FONT></SPAN></DIV>
  <DIV><SPAN><FONT face=Arial size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN><FONT face=Arial size=2>In my script I want to convert 14105 bytes 
  to kilobytes and and this is what I do:</FONT></SPAN></DIV>
  <DIV><SPAN></SPAN>&nbsp;</DIV>
  <DIV><SPAN><FONT face=Arial size=2>&gt;&gt;&gt; s = 14105</FONT></SPAN></DIV>
  <DIV><SPAN><FONT face=Arial size=2>&gt;&gt;&gt; print '%0.2f' % 
  (s/1024)<BR>13.00</FONT>&nbsp;</SPAN></DIV>
  <DIV><SPAN><FONT face=Arial size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN><FONT face=Arial size=2>This not correct and I don't know why. The 
  answer is 13.77.</FONT></SPAN></DIV>
  <DIV><SPAN><FONT face=Arial size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN><FONT face=Arial size=2>Any pointers please that would help my in 
  the right direction?</FONT></SPAN></DIV>
  <DIV><SPAN><FONT face=Arial size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN><FONT face=Arial size=2>Thanks</FONT></SPAN></DIV>
  <DIV><SPAN><FONT face=Arial size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN><FONT face=Arial size=2>Johan</FONT></SPAN></DIV></DIV><SPAN 
  class=sg><BR>
  <P><FONT size=2>--<BR>No virus found in this outgoing message.<BR>Checked by 
  AVG Free Edition.<BR>Version: 7.5.432 / Virus Database: 268.16.13/632 - 
  Release Date: 2007/01/16 04:36 
  PM<BR></FONT></P></SPAN><BR>_______________________________________________<BR>Tutor 
  maillist &nbsp;- &nbsp;<A 
  onclick="return top.js.OpenExtLink(window,event,this)" 
  href="mailto:Tutor@python.org">Tutor@python.org</A><BR><A 
  onclick="return top.js.OpenExtLink(window,event,this)" 
  href="http://mail.python.org/mailman/listinfo/tutor" 
  target=_blank>http://mail.python.org/mailman/listinfo/tutor</A><BR><BR><BR></BLOCKQUOTE></DIV><BR><BR>
<P><FONT size=2>--<BR>No virus found in this incoming message.<BR>Checked by AVG 
Free Edition.<BR>Version: 7.5.432 / Virus Database: 268.16.13/632 - Release 
Date: 2007/01/16 04:36 PM<BR></FONT></P></BODY></HTML>
<BR>

<P><FONT SIZE=2>--<BR>
No virus found in this outgoing message.<BR>
Checked by AVG Free Edition.<BR>
Version: 7.5.432 / Virus Database: 268.16.13/632 - Release Date: 2007/01/16 04:36 PM<BR>
</FONT> </P>