I have a random question about conversion on this plugin. I apologise if it sounds stupid but I could not find anyone raise an issue with this or even talk about it. But this has me stumped. I am using this plugin https://github.com/blueimp/jQuery-File-Upload
I thought it was a bug but found this piece of code
_formatFileSize: function (bytes) {
if (typeof bytes !== 'number') {
return '';
}
if (bytes >= 1000000000) {
return (bytes / 1000000000).toFixed(2) + ' GB';
}
if (bytes >= 1000000) {
return (bytes / 1000000).toFixed(2) + ' MB';
}
return (bytes / 1000).toFixed(2) + ' KB';
},
According to this, KB are caculated using 1000bytes not 1024. So I am abit confused because windows is showing me 1024 when checking the file size, alot of stackoverflow questions show using 1024.
This shows answers with 1024 bytes PHP filesize MB/KB conversion
At the same time, there are answers here of doing it both ways. So my question is which one should I be using and should it matter?