Path: utzoo!attcan!uunet!aplcen!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!tut.cis.ohio-state.edu!rutgers!mcnc!decvax.dec.com!elrond!shodsdon From: shodsdon@elrond.CalComp.COM (Steve V. Hodsdon) Newsgroups: comp.lang.c Subject: Re: Need help inputting Float #'s Message-ID: <2834@elrond.CalComp.COM> Date: 18 Jul 90 17:10:50 GMT References: Reply-To: shodsdon@elrond.UUCP (Steve V. Hodsdon) Distribution: na Organization: Calcomp Display Products Division, Hudson, NH, USA Lines: 43 In article hart@blackjack.dt.navy.mil (Michael Hart) writes: # #Yes, this is probably a stupid, obvious (RTFM) #question to all you C geniuses, but, I have #RTFM and the FM is not very explicit. What #a surprise. # #I am trying to input a floating point number into #my prog, in the format nnnnnn.mm . Using the following #code, I see that it is reading the correct number #of chars, but apparantly either is not storing them #the way I want, or just not printing them out. # #Please respond via E-mail; that way I won't get too #many flames for this question. Tried to, can't get there from here :-) #thanx # #code follows: #======================================= #[...> # sscanf(buffer,"%f%n",&number,&c1); ^^ -> should be %lf #[...]> #======================================== # #-- #------------------------------------------------------------------------------- #Michael G. Hart hart@blackjack.dt.navy.mil / mhart@dtrc.dt.navy.mil #DTRC/DoD | "Wherever you go, there you are."- me #DISCLAIMER: If you want the Navy's opinion, talk to Secretary Cheney. This is a mistake that I make all the time, also. Someday... -- Steve Hodsdon CalComp Display Products Division, A Lockheed Co. 65 River Rd, Hudson, NH 03051-0908 shodsdon@elrond.CalComp.COM (603) 885-8324 {decvax|harvard}!elrond!shodsdon