struct MemoryConversion::Bytes

Defined in:

bytes.cr

Constructors

Instance Method Summary

Macro Summary

Constructor Detail

def self.new(value) #

[View source]

Instance Method Detail

def to_b_s #

Produce a string representing this byte value like "##B".


[View source]
def to_bits : BigFloat #

Convert this number of bytes to the equivalent number of bits


[View source]
def to_byte_s #

Produce a string representing this byte value like "## bytes".


[View source]
def to_bytes : BigFloat #

Convert this number of bytes to the equivalent number of bytes


[View source]
def to_eb_s #

Produce a string representing this byte value like "##EB".


[View source]
def to_exabits : BigFloat #

Convert this number of bytes to the equivalent number of Exabits


[View source]
def to_exabyte_s #

Produce a string representing this byte value like "## Exabytes".


[View source]
def to_exabytes : BigFloat #

Convert this number of bytes to the equivalent number of Exabytes


[View source]
def to_gb_s #

Produce a string representing this byte value like "##GB".


[View source]
def to_gigabits : BigFloat #

Convert this number of bytes to the equivalent number of Gigabits


[View source]
def to_gigabyte_s #

Produce a string representing this byte value like "## Gigabytes".


[View source]
def to_gigabytes : BigFloat #

Convert this number of bytes to the equivalent number of Gigabytes


[View source]
def to_kb_s #

Produce a string representing this byte value like "##kB".


[View source]
def to_kilobits : BigFloat #

Convert this number of bytes to the equivalent number of kilobits


[View source]
def to_kilobyte_s #

Produce a string representing this byte value like "## kilobytes".


[View source]
def to_kilobytes : BigFloat #

Convert this number of bytes to the equivalent number of kilobytes


[View source]
def to_mb_s #

Produce a string representing this byte value like "##MB".


[View source]
def to_megabits : BigFloat #

Convert this number of bytes to the equivalent number of Megabits


[View source]
def to_megabyte_s #

Produce a string representing this byte value like "## Megabytes".


[View source]
def to_megabytes : BigFloat #

Convert this number of bytes to the equivalent number of Megabytes


[View source]
def to_pb_s #

Produce a string representing this byte value like "##PB".


[View source]
def to_petabits : BigFloat #

Convert this number of bytes to the equivalent number of Petabits


[View source]
def to_petabyte_s #

Produce a string representing this byte value like "## Petabytes".


[View source]
def to_petabytes : BigFloat #

Convert this number of bytes to the equivalent number of Petabytes


[View source]
def to_s(scale : Symbol | Nil = nil) #
Description copied from class Object

Returns a nicely readable and concise string representation of this object, typically intended for users.

This method should usually not be overridden. It delegates to #to_s(IO) which can be overridden for custom implementations.

Also see #inspect.


[View source]
def to_storage_bits : BigFloat #

Convert to storage bytes and then multiply by 8.


[View source]
def to_storage_bytes : BigFloat #

Convert this number of bytes to the equivalent number of bytes. This uses the metric used by storage manufacturers to inflate their capacity values, by using powers of 10 instead of powers of two.


[View source]
def to_storage_exabits : BigFloat #

Convert to storage bytes and then multiply by 8.


[View source]
def to_storage_exabytes : BigFloat #

Convert this number of bytes to the equivalent number of Exabytes. This uses the metric used by storage manufacturers to inflate their capacity values, by using powers of 10 instead of powers of two.


[View source]
def to_storage_gigabits : BigFloat #

Convert to storage bytes and then multiply by 8.


[View source]
def to_storage_gigabytes : BigFloat #

Convert this number of bytes to the equivalent number of Gigabytes. This uses the metric used by storage manufacturers to inflate their capacity values, by using powers of 10 instead of powers of two.


[View source]
def to_storage_kilobits : BigFloat #

Convert to storage bytes and then multiply by 8.


[View source]
def to_storage_kilobytes : BigFloat #

Convert this number of bytes to the equivalent number of kilobytes. This uses the metric used by storage manufacturers to inflate their capacity values, by using powers of 10 instead of powers of two.


[View source]
def to_storage_megabits : BigFloat #

Convert to storage bytes and then multiply by 8.


[View source]
def to_storage_megabytes : BigFloat #

Convert this number of bytes to the equivalent number of Megabytes. This uses the metric used by storage manufacturers to inflate their capacity values, by using powers of 10 instead of powers of two.


[View source]
def to_storage_petabits : BigFloat #

Convert to storage bytes and then multiply by 8.


[View source]
def to_storage_petabytes : BigFloat #

Convert this number of bytes to the equivalent number of Petabytes. This uses the metric used by storage manufacturers to inflate their capacity values, by using powers of 10 instead of powers of two.


[View source]
def to_storage_terabits : BigFloat #

Convert to storage bytes and then multiply by 8.


[View source]
def to_storage_terabytes : BigFloat #

Convert this number of bytes to the equivalent number of Terabytes. This uses the metric used by storage manufacturers to inflate their capacity values, by using powers of 10 instead of powers of two.


[View source]
def to_storage_yottabits : BigFloat #

Convert to storage bytes and then multiply by 8.


[View source]
def to_storage_yottabytes : BigFloat #

Convert this number of bytes to the equivalent number of Yottabytes. This uses the metric used by storage manufacturers to inflate their capacity values, by using powers of 10 instead of powers of two.


[View source]
def to_storage_zettabits : BigFloat #

Convert to storage bytes and then multiply by 8.


[View source]
def to_storage_zettabytes : BigFloat #

Convert this number of bytes to the equivalent number of Zettabytes. This uses the metric used by storage manufacturers to inflate their capacity values, by using powers of 10 instead of powers of two.


[View source]
def to_tb_s #

Produce a string representing this byte value like "##TB".


[View source]
def to_terabits : BigFloat #

Convert this number of bytes to the equivalent number of Terabits


[View source]
def to_terabyte_s #

Produce a string representing this byte value like "## Terabytes".


[View source]
def to_terabytes : BigFloat #

Convert this number of bytes to the equivalent number of Terabytes


[View source]
def to_yb_s #

Produce a string representing this byte value like "##YB".


[View source]
def to_yottabits : BigFloat #

Convert this number of bytes to the equivalent number of Yottabits


[View source]
def to_yottabyte_s #

Produce a string representing this byte value like "## Yottabytes".


[View source]
def to_yottabytes : BigFloat #

Convert this number of bytes to the equivalent number of Yottabytes


[View source]
def to_zb_s #

Produce a string representing this byte value like "##ZB".


[View source]
def to_zettabits : BigFloat #

Convert this number of bytes to the equivalent number of Zettabits


[View source]
def to_zettabyte_s #

Produce a string representing this byte value like "## Zettabytes".


[View source]
def to_zettabytes : BigFloat #

Convert this number of bytes to the equivalent number of Zettabytes


[View source]

Macro Detail

macro method_missing(call) #

[View source]