Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

conversion 1

Status
Not open for further replies.

XoFF

Programmer
Jun 22, 2003
23
GB
when i enter a float in my program he always shows 4 digits after the point. but i dont want leading zero's so:

5.2 not 5.2000
5 not 5.0000
5.236 not 5.2360

It's hard to explain because english isn't my mother tongue

 
i meant 6 digits after point so

5.2 not 5.200000
5 not 5.000000
5.236 not 5.236000

so I don't want any useless zero's without predefining like %5.2f
 
you need to specify format like %5.2f
precision 6 is default format for float in C
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top