-4

I am taking a picture and i am converting it into Base64 string. And i am able to calculate the size of the picture in KB. I need to know the formula to calculate the size in MB. Please clarify.

The below code works fine for calculating size in KB.

function onCameraClick() {
      var base64Val = kony.convertToBase64(frmImageSize.camCamera.rawBytes);
      var imageSizeinKB = base64Val.length*0.75 )/1024;        
}
user4261201
  • 2,324
  • 19
  • 26
SibhiRajan
  • 45
  • 1
  • 1
  • 5

1 Answers1

0

For your reference:
1024 bytes = 1 KB
1024 KB = 1 MB
1024 MB = 1 GB
1024 GB = 1 TB

So if you have arrived result in KB, to get the result in MB please divide it by 1024.

Result in MB = result in KB/1024.