abstract struct Number

Overview

The top-level number type.

Included Modules

Defined in:

wrench/humanize.cr

Constant Summary

SIZE_PREFIXES = { {" Bytes", " KiloBytes", " MegaBytes", " GigaBytes", " TeraBytes", " PetaBytes", " ExaBytes", " ZettaBytes", " YottaBytes"}, {" Bytes", " KiloBytes", " MegaBytes", " GigaBytes", " TeraBytes", " PetaBytes", " ExaBytes", " ZettaBytes", " YottaBytes"} }

Class Method Summary

Class Method Detail

def self.si_prefix(magnitude : Int, prefixes = SI_PREFIXES) : Char | String | Nil #

Returns the SI prefix for magnitude.

Number.si_prefix(3) # => 'k'

[View source]