Determines if another number is approximately equal within a given _n_th degree. Defaults to 100ths if the degree is not specified.
Returns the distance between self an another value. This is the same as #- but it provides an alternative for common naming between variant classes.
4.distance(3) #=> 1
Formated string of bits proportial to size.
1024.bits_to_s #=> "1.00 kb" 1048576.bits_to_s #=> "1.00 mb" 1073741824.bits_to_s #=> "1.00 gb" 1099511627776.bits_to_s #=> "1.00 tb"
Takes a format string to adjust output.
1024.bits_to_s('%.0f') #=> "1 kb"
Formated string of bytes proportial to size.
1024.bytes_to_s #=> "1.00 KB" 1048576.bytes_to_s #=> "1.00 MB" 1073741824.bytes_to_s #=> "1.00 GB" 1099511627776.bytes_to_s #=> "1.00 TB"
Takes a format string to adjust output.
1024.bytes_to_s('%.0f') #=> "1 KB"