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.
Blocks :
Documentation :
All blocks are simple, I think no need to explain.
Download :
com.appybuilder.The_K_Studio.ByteTools.aix (6.2 KB)
Note :
This can be done without extension. Extension is developed to simplify the work.
Donate something to support
12 Likes
Nice work !!!
Can i make a suggestion ?
Add blocks by inverting the values Kb To B, Tb to Gb, Mb to Kb, etc
1 Like
Thanks for suggestions, I will add these methods.
1 Like
Last (i’m sorry) 1024 Tb = 1 Petabyte
1 Like
Cool work!!
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.
1 Like
themaayur
(Mayur Berad)
November 7, 2020, 6:45am
#6
Nice Extension @The_K_Studio
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
1 Like
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.
Cheers!
yusufcihan
(Yusuf Cihan)
November 7, 2020, 7:11am
#12
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
2 Likes
Yes you are right !!!
I’m from for old school
Storage Device
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 !!!
2 Likes
Kshitij
(Kshitij Vats)
November 7, 2020, 7:41am
#15
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!
2 Likes
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.
1 Like