$ perl -l use strict; use warnings; use Number::Bytes::Human qw(format_bytes); print format_bytes(1E9, bs => 1000); print format_bytes(1E9, bs => 1024); __END__ 1.0G 954M