Linked Questions

13 votes
1 answer
23k views

I want to convert file size MB format which is coming in Bytes at present. Below is my code: var x = document.getElementById("file"); var txt = ""; var totalSize = 0; if ('files' in x) { if (x....
Akash M's user avatar
  • 509
4 votes
1 answer
4k views

how to convert 4000 kilobytes to 4 megabytes in javascript? i have tried function formatSizeUnits(bytes){ if (bytes>=1073741824) {bytes=(bytes/1073741824).toFixed(2)+' GB';} ...
Krishnan-777's user avatar
-1 votes
1 answer
7k views

I want to convert 1000000 to 1M also for 1000 To 1K Any ideas? I need it for my special project
Kyle Mods's user avatar
-3 votes
2 answers
519 views

i've using this link for getting remote file size but i am getting sizes in bites i want to show that in Kb,Mb or in Gb
Richie Rich's user avatar
0 votes
0 answers
150 views

I am getting the sum of the values from a column of my ng-repeat. I am getting it already but the value is in bytes. I need to convert it directly to GB in order for me to use in on my other opertion. ...
bleyk's user avatar
  • 799
0 votes
0 answers
106 views

please can someone help me out here. I am having a website where I use the ipsw.me API to display the latest iOS firmware IPSW files. I use the Javascript below to call the information from the API ...
Mobiprox Man's user avatar
1570 votes
18 answers
1.8m views

I'd like to convert a float to a whole number in JavaScript. Actually, I'd like to know how to do BOTH of the standard conversions: by truncating and by rounding. And efficiently, not via converting ...
mcherm's user avatar
  • 24.8k
725 votes
13 answers
629k views

Since localStorage (currently) only supports strings as values, and in order to do that the objects need to be stringified (stored as JSON-string) before they can be stored, is there a defined ...
Codekie's user avatar
  • 7,904
149 votes
11 answers
265k views

How can I convert the output of PHP's filesize() function to a nice format with MegaBytes, KiloBytes etc? like: if the size is less than 1 MB, show the size in KB if it's between 1 MB - 1 GB show it ...
Alex's user avatar
  • 66.6k
34 votes
3 answers
83k views

How do I convert file size to MB only in JavaScript, It comes back as a long INT sometimes and I would like to convert this to a MB instead of it showing bytes or kb. If possible I would like too ...
Webmaster.Gotactics's user avatar
23 votes
5 answers
69k views

I know react-native-fs and react-native-fetch-blob, but I'm missing simple helper functions like getFileInfo(file). Desired pseudo code: let fileInfo = getFileInfo('path/to/my/file.txt'); console....
Mr. B.'s user avatar
  • 8,825
1 vote
1 answer
6k views

I am trying to automate chart creation in google sheets for which I need to convert a column data from KB to GB. How can this be done using google apps script?
strongpoint's user avatar
2 votes
2 answers
1k views

The code is as follows. function formatBytes(bytes,decimals) { if(bytes == 0) return '0 Byte'; var k = 1000; // or 1024 for binary var dm = decimals + 1 || 3; var sizes = ['Bytes', 'KB', '...
Tomorrow's user avatar
2 votes
2 answers
1k views

i'm working on a django website and i have a view where the user is able to upload videos and i need to add a button for the user so he can make a short test for his upload speed after a lot of ...
YahyaST18's user avatar
  • 101
1 vote
1 answer
2k views

Info: I want to upload multiple file using tus-js-client. I am facing some issue when i try to upload multiple files. Issues: If i try to upload multiple files The progress bar is fluctuating because ...
afi's user avatar
  • 593

15 30 50 per page