filesize icon indicating copy to clipboard operation
filesize copied to clipboard

Need to parse file size from input string.

Open ghost opened this issue 3 years ago • 0 comments

Please add functionality to parse file size from the input string. for many applications, the file size limit will be given from the backend and it will be like 1MB or 1GB etc.

So please add functionality to convert a given string into required bytes or kb.

For example, if I need to get '1MB'( string from backend) in bytes, the function would be like,

int sizeInBbytes = fileSize.parse('1MB', outputFormat:bytes);

which outputs 1024

ghost avatar Aug 04 '22 11:08 ghost