Introducing simple but useful extension : ByteTools - Convert Bytes into Kilobytes, Megabytes, Gigabytes, Terabytes & Petabytes and Vice Versa.
The conversion is based on the International System of Units (SI) by considering 1MB = 1000KB.
All blocks are simple, I think no need to explain.
com.appybuilder.The_K_Studio.ByteTools.aix (6.2 KB)
This can be done without extension. Extension is developed to simplify the work.
Donate something to support
Nice work !!!
Can i make a suggestion ?
Add blocks by inverting the values Kb To B, Tb to Gb, Mb to Kb, etc
Thanks for suggestions, I will add these methods.
Last (i’m sorry) 1024 Tb = 1 Petabyte
And I too have a suggestion…
When we use any converter; for e.g. 100000 gb to tb, the extension can add the unit by itself instead of the developer to use the join block to add the converted unit. i.e result should be 100 TB instead of just 100.
I have left it on the user to join the unit in his required format. Because some users like the unit format as Kb, Mb, Gb or KB, MB, GB or Kilobytes, Megabytes, Gigabytes etc.
So, the user can use according to his requirement bu using Join block.
The right answer would be 100000 gb / (1024 gb = 1 Tb) = 97,65625 Tb
There are 2 systems to convert file sizes. 1. SI & 2. Binary
In SI, 1Mb = 1000Kb &
In Binary, 1Mb = 1024Kb
Read more at:
A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.
Added reverse methods and extension is updated.
You can also add automatic conversion:
If the KB is bigger than 1000 or 1024, show as MB.
If the MB is bigger than 1000 or 1024 (after converting to MB from KB), show it as GB etc.
1000 KB --> 1000 KB
1250 KB --> 1,25 MB
1.300.000 KB --> 1,3 GB
Yes you are right !!!
I’m from for old school
1 Cluster = 8 sectors
1 Sector = 512 bytes
1 Kb = 1024 bytes
In the 90’s I studied systems programmer analyst (i’m old i know )
Thank so much for considering my suggestion !!!
Am in 6th at the moment. And I know HTML, C++, Python and the next I am learning is JAVA…
It would be better if you do something like:
Use switch-case, if-else etc.
Anyway, great start!
Hi, just want to report something:
Why it returns negative?
I think it is due to the limit of number of maximum digits.
Then you might want to solve it
BigDecimal is one of the options for big numbers.