4 Replies Latest reply on Jun 1, 2016 4:57 AM by Ashish Chaudhari

    Automatic Byte conversion from  kilobyte(KB) to megabyte(MB) to gigabyte(GB) to petabyte(PB)

    sidharth patro

      Hi People,

      I have a field named file_size which will contain the size of files in bytes. I want to display those values with suffix KB,MB,GB and PB automatically.The displaying of suffix cannot be done in formatting level because it will not automatic. I built one calculation which is displaying with the suffix but not able to use it with aggregation.

      Example:

      lets consider I have a file_size value - 2048, 300,500 (all are in KB)

      The display value should be - 2MB,300KB,500KB

      if I take the sum(file_size) then it should display as 2.85MB (2848/1024 = 2.848)

       

      similarly if I have sum(file_size) is 28484567 then it should display as 28.48GB

       

      Please suggest some ideas. Thank you in advance