Functions and Macros
The Functions and Macros exported by the package:
UnitfulData.prefixed_data
— Constantconst prefixed_data
A dictionary that contains the most common prefixes for unit of Information in metric and IEC format.
The keys of the dictionary are tuples of the form (n, b)
, where n
is the exponent and b
is the base. The values of the dictionary are strings representing the corresponding prefixes.
UnitfulData.data_summary
— Methoddata_summary(ex; unit::Unitlike=Byte, exclude=Union{...}, chargeall=Union{...})
Wrapper around Base.summarysize
that returns the size of the data in the specified unit. If unit
is not a Data
unit, it defaults to Byte
.
See also: @data_allocated
, Base.summarysize
UnitfulData.@data_allocated
— Macro@data_allocated(ex,unit=Byte)
A macro to evaluate an expression, discarding the resulting value, instead returning the total size of the allocated memory in a unit of UnitfulData.Byte
. If unit
is specified, the result is converted to that unit. By default, the result is in Bytes.
See also Base.@allocations
, data_summary
julia> @data_allocated rand(10^6) MByte
8.000080 MBytes
UnitfulData.@unit_custom_prefix
— Macro@unit_custom_prefix(symb,abbr,name, _prefix,autodocs=false)
A macro to create prefixed units. The macro creates a unit with the specified symbol, abbreviation, and name. The unit is prefixed by the values in _prefix
. If autodocs
is true, the macro will generate a docstring for the unit.
```jldoctest julia> @unit utest "utest" uTests 1bit false utest
julia> @unitcustomprefix utest "utest" uTest _prefix=Dict((2,10)=>"hecto") hectotest
```See also: [
Unitful.@unit`](@extref)