MetricPrefix.dec

Converts n into a metric prefixed representation.

struct MetricPrefix
typeof(&this)
dec
(
T : float
)
(
T n
,
int e = 0
)

Parameters

n T

number to convert

e int

input prefix: 0 = None, 1 = 'k', -1 = 'm', 2 = 'M', -2 = 'µ' etc., up to +/- 4

Return Value

Type: typeof(&this)

this instance

Examples

For n == 12345678 this.scaled is about 12.35 and this.prefix is 'M'.

Meta