Skip to contents

This function reads a prefix from a string and returns the exponent (base-10) that this prefix represents.

Usage

unit.scale(prefix)

Arguments

prefix

a string, e.g.: "M", "mega", "m", "milli", "µ", "micro", etc.

Value

an integer that corresponds to the prefix, defaults to 0.

Examples