Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. large numbers

large numbers

Scheduled Pinned Locked Moved C / C++ / MFC
question
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    locoone
    wrote on last edited by
    #1

    7.25 GB (7,792,175,104 bytes) is what windows says. -797759488 bytes is what findfile .GetLength() says what do i need to do to make it show as 7.25 gb?

    N N 2 Replies Last reply
    0
    • L locoone

      7.25 GB (7,792,175,104 bytes) is what windows says. -797759488 bytes is what findfile .GetLength() says what do i need to do to make it show as 7.25 gb?

      N Offline
      N Offline
      Naveen
      wrote on last edited by
      #2

      try GetFileSizeEx()

      nave

      L 1 Reply Last reply
      0
      • L locoone

        7.25 GB (7,792,175,104 bytes) is what windows says. -797759488 bytes is what findfile .GetLength() says what do i need to do to make it show as 7.25 gb?

        N Offline
        N Offline
        Nelek
        wrote on last edited by
        #3

        Hi, another option is to divide by 1024 as long as you don't have the format you want. 7,792,175,104 / 1024.0 = 7609546 7609546 / 1024.0 = 7431,197265625 7431,197265625 / 1024.0 = 7,2570285797119140625 and make a Round () or a Trunc () Ehmm, I suppose you have a type missing in your post of findfile.GetLength () 797,759,488 --> 7977594880 / 1024.0 = 7790620 7790620 / 1024.0 = 7608,02734375 7608,02734375 / 1024.0 = 7,429714202880859375 Don't ask me about why the results are different ;) :P

        Greetings. -------- M.D.V. If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?

        L 1 Reply Last reply
        0
        • N Naveen

          try GetFileSizeEx()

          nave

          L Offline
          L Offline
          locoone
          wrote on last edited by
          #4

          no matter what i try i cant get it to work right files under 2 gb is right but anything bigger is wrong

          1 Reply Last reply
          0
          • N Nelek

            Hi, another option is to divide by 1024 as long as you don't have the format you want. 7,792,175,104 / 1024.0 = 7609546 7609546 / 1024.0 = 7431,197265625 7431,197265625 / 1024.0 = 7,2570285797119140625 and make a Round () or a Trunc () Ehmm, I suppose you have a type missing in your post of findfile.GetLength () 797,759,488 --> 7977594880 / 1024.0 = 7790620 7790620 / 1024.0 = 7608,02734375 7608,02734375 / 1024.0 = 7,429714202880859375 Don't ask me about why the results are different ;) :P

            Greetings. -------- M.D.V. If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?

            L Offline
            L Offline
            locoone
            wrote on last edited by
            #5

            anything under 2 gb is right but if the file is bigger than that its wrong it shows a 12 gig file as 2.something gb

            N 1 Reply Last reply
            0
            • L locoone

              anything under 2 gb is right but if the file is bigger than that its wrong it shows a 12 gig file as 2.something gb

              N Offline
              N Offline
              Nelek
              wrote on last edited by
              #6

              Mmmm, it maybe is because of the large... dunno :doh:

              Greetings. -------- M.D.V. If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups