Path: utzoo!attcan!uunet!cs.utexas.edu!know!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!haven!cs.wvu.wvnet.edu!cerc.wvu.wvnet.edu!cathedral!siping From: siping@cathedral.cerc.wvu.wvnet.edu (Siping Liu) Newsgroups: comp.lang.c Subject: **** a simple question **** Message-ID: <793@babcock.cerc.wvu.wvnet.edu> Date: 14 Sep 90 21:20:00 GMT Sender: news@cerc.wvu.wvnet.edu Lines: 15 How can I print out ONLY the significant digits of a float number? As you know, "%f" fills in zero's if the number does not have enough non-zero digits after the point. I'd like to have: for 3.12, print out 3.12; for 3.0, print out 3.0; for 3.12349, print out 3.1235; (4 digits at most after the point) How can I do this? Thanks for your help. siping@cerc.wvu.wvnet.edu