Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

File size calculation (mb, gb, tb, etc)

Featured Replies

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!

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" )

  • 2 weeks later...

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

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.