function phabricator_format_relative_time($duration) { return phabricator_format_units_generic($duration, array(60, 60, 24, 7), array('s', 'm', 'h', 'd', 'w'), $precision = 0); }
/** * Format a byte count for human consumption, e.g. "10MB" instead of * "10000000". * * @param int Number of bytes. * @return string Human-readable description. */ function phabricator_format_bytes($bytes) { return phabricator_format_units_generic($bytes, array(1000, 1000, 1000, 1000, 1000), array('B', 'KB', 'MB', 'GB', 'TB', 'PB'), $precision = 0); }