I have in a table filenames and sizes but don’t know how to calculate the total file size in the row example filename. File size file1———2098656 file2———5637484 file3———6788977 i want to calculate the file size in a loop
@NogDogAug 18.2019 — #We'll need to know how it's stored in the code (e.g. array structure?), or are you looking for a SQL approach, or what? If it's in some sort of array, just loop on it and increment a variable: <i> </i>$total = 0; foreach($data as $row) { $total += $row['file_size']; // or whatever it's called } echo "Total is: $total";
@RichardSusskind1Aug 27.2019 — #As the resolution and bit depth of digital detectors continue to improve, the user often gets excited about the improved image quality. Your IT person however may not share your enthusiasm when they see the size of the files being stored. One quick way to calculate the file size of your new system is to calculate the total number of pixels in the detector, multiply that by the number of bits of bit depth and divide the result by 8 (because there are 8 bits in a byte)