May 22, 201213 yr Hey guys, I've developed a small application used by data technicians (me) on film sets which keeps track of how much data has been transferred and stored from the camera magazines. I have a portal where the tech can enter how much data was transferred, whether it's in kb, mb, gb, tb, etc. I need to develop some way for the user to define if the data transferred was in megabytes, or terabytes, (etc), and for a field to calculate the total transferred for the day. I want the field to be able to automatically trail the total with a "mb", "gb", or "tb" depending on how big the total is (kind of how Finder on Mac can determine how much space is remaining on the hard drive). Any input is appreciated as I'm unsure where to start here aside from the basic calculations. Cheers!
May 22, 201213 yr Assuming you know the total throughput in bytes, start by calculating the order of magnitude as = Case ( throughput ; Floor ( Ln ( throughput ) / Ln ( 1024 ) ) ; 0 ) Then you can use the result to select the correct suffix, e.g. = Case ( magnitude ; Middle ( "KMGTPEZY" ; magnitude ; 1 ) & "B" ; "bytes" )
June 2, 201213 yr Well, I was beginning to think this one has gone unnoticed, but apparently I was wrong: http://www.briandunning.com/cf/1447 :no:
Create an account or sign in to comment