Functions and Macros

The Functions and Macros exported by the package:

UnitfulData.prefixed_dataConstant
const 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.

source
UnitfulData.@data_allocatedMacro
@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
source
UnitfulData.@unit_custom_prefixMacro
@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)

source