When we get a file size, we usually get it in bytes. It’s ok to have this value, but, when giving the user this information, we must convert it to another unit to make it a little more accessible. When talking about megabytes or gigabytes, everyone will make a mess. So here are some snippets to help us do that: