エントリーの編集
エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
記事へのコメント1件
- 注目コメント
- 新着コメント
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています
- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
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 ... 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
2012/04/11 リンク