From: ·······@gmail.com
Subject: summing float
Date: 
Message-ID: <db200718-86c1-4aa2-ae76-4a08b7136d92@i7g2000prf.googlegroups.com>
I am summing up a bunch of decimal number and i get a the answer

	7.220782e+8
how to i covert the above to 722078200.00 normal decimal number
format.

sorry i a bit ignorant when it comes to number representation

many thanks

George

From: Barry Margolin
Subject: Re: summing float
Date: 
Message-ID: <barmar-9BE0DE.01244131012008@comcast.dca.giganews.com>
In article 
<····································@i7g2000prf.googlegroups.com>,
 ·······@gmail.com wrote:

> I am summing up a bunch of decimal number and i get a the answer
> 
> 	7.220782e+8
> how to i covert the above to 722078200.00 normal decimal number
> format.
> 
> sorry i a bit ignorant when it comes to number representation
> 
> many thanks
> 
> George

(format nil "~,2F" 7.220782e+8)

-- 
Barry Margolin, ······@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
From: Kent M Pitman
Subject: Re: summing float
Date: 
Message-ID: <ufxwefr1j.fsf@nhplace.com>
·······@gmail.com writes:

> I am summing up a bunch of decimal number and i get a the answer
> 
> 	7.220782e+8
> how to i covert the above to 722078200.00 normal decimal number
> format.
   
If you look at:

22.3.3.1 Tilde F: Fixed-Format Floating-Point
C:\Program Files\LispWorks\LispWorks 4.4.5 Professional\lib\4-4-0-0\manual\online\web\CLHS\Body\22_cca.htm

You'll see this text (among other discussion):

   The full form is ~w,d,k,overflowchar,padcharF. The parameter w is
   the width of the field to be printed; d is the number of digits to
   print after the decimal point; k is a scale factor that defaults to
   zero.
   ...
   If the w parameter is omitted, then the field is of variable
   width. In effect, a value is chosen for w in such a way that no
   leading pad characters need to be printed and exactly d characters
   will follow the decimal point. For example, the directive ~,2F will
   print exactly two digits after the decimal point and as many as
   necessary before the decimal point.

So that means:

   (format t "~,2F" 7.220782e+8)
   722078200.00
   => NIL
From: ·······@gmail.com
Subject: Re: summing float
Date: 
Message-ID: <44d95d55-b33f-4287-b9ad-d761e97f6825@s13g2000prd.googlegroups.com>
On Jan 31, 5:27 pm, Kent M Pitman <······@nhplace.com> wrote:
> ·······@gmail.com writes:
> > I am summing up a bunch of decimal number and i get a the answer
>
> >    7.220782e+8
> > how to i covert the above to 722078200.00 normal decimal number
> > format.
>
> If you look at:
>
> 22.3.3.1 Tilde F: Fixed-Format Floating-Point
> C:\Program Files\LispWorks\LispWorks 4.4.5 Professional\lib\4-4-0-0\manual\online\web\CLHS\Body\22_cca.htm
>
> You'll see this text (among other discussion):
>
>    The full form is ~w,d,k,overflowchar,padcharF. The parameter w is
>    the width of the field to be printed; d is the number of digits to
>    print after the decimal point; k is a scale factor that defaults to
>    zero.
>    ...
>    If the w parameter is omitted, then the field is of variable
>    width. In effect, a value is chosen for w in such a way that no
>    leading pad characters need to be printed and exactly d characters
>    will follow the decimal point. For example, the directive ~,2F will
>    print exactly two digits after the decimal point and as many as
>    necessary before the decimal point.
>
> So that means:
>
>    (format t "~,2F" 7.220782e+8)
>    722078200.00
>    => NIL

thanks