#!/usr/bin/env ruby require 'human_size' test_value = [-10, 0, 9, 98, 987, 987_6, 987_65, 987_654, 987_654_3, 987_654_32, 987_654_321, 123_456_789_876_543_21] printf "\t%20s | %20s | %20s |\n", 'Original', 'Binary', 'Si' printf "\t%20s + %20s + %20s +\n", '-' * 20, '-' * 20, '-' * 20 h = HumanSize.new test_value.each do |x| printf "\t%20s | %20s | %20s |\n", x, h.human_size(x), h.human_size(x, false) end printf "\t%20s + %20s + %20s +\n", '-' * 20, '-' * 20, '-' * 20