Results 1 to 3 of 3

Thread: fprintf() and setprecision

  1. #1
    Member Contributor
    Join Date
    Oct 2002
    Posts
    55

    fprintf() and setprecision

    Alright, as many of you probably know, im just finishing up my .ase -> .dan converter... it exports now (the only reason for this, is to get rid of some spaces (.ase file = 45 megs, .dan right now is 22.8..) but, when i use fprintf() to export my normals.. even though in their arrays they are 0.xxxx, when it exports them, all of them are 0.xxxx00, is there anything like setprecision for fprintf() so that i can get it to only print to 4 decimal places?
    Thanks in advance,
    Dan Sherman

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,978

    Re: fprintf() and setprecision

    Code :
    printf("%.4f", ...);

  3. #3
    Member Contributor
    Join Date
    Oct 2002
    Posts
    55

    Re: fprintf() and setprecision

    Whoo Hoo!!! yay, dont have class today, but ill remember that for tomorrow... w00t. Thats awesome, i calculated it out, with those 2 extra 0's at the end of each number, i had around an extra 800k 0's... that were useless... that should cut the file size down a bit!
    Thanks a ton man
    Love you forever!
    Dan Sherman

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean