タグ

関連タグで絞り込む (0)

  • 関連タグはありません

タグの絞り込みを解除

j2eeとfileに関するtvskのブックマーク (1)

  • Format file size as MB, GB, etc

    I need to display a file size as a string using sensible units. For example, 1L ==> "1 B"; 1024L ==> "1 KB"; 2537253L ==> "2.3 MB" etc. I found this previous answer, which I didn't find satisfactory. I have come up with my own solution which has similar shortcomings: private static final long K = 1024; private static final long M = K * K; private static final long G = M * K; private static final l

    Format file size as MB, GB, etc
    tvsk
    tvsk 2012/04/11
    ヒューマンリーダブルファイルサイズの取得 q"File.length GB"
  • 1