Skip to content

Main content

Engineering Exponent Prefix Choice Tool

Look up an exact engineering exponent in a caller-supplied prefix table; absent exponents are explicit.

Loading tool…

Description

Look up the supplied exponent exactly; return its prefix or empty text with matched false.

A unit label is text describing a quantity's intended scale. Joining tokens, adding powers or choosing spacing changes presentation; it does not convert the quantity, validate dimensional compatibility or verify a unit registry entry.

Look up the supplied exponent exactly; return its prefix or empty text with matched false.

When to use this tool

Use Engineering Exponent Prefix Choice when you need a specific quantity-and-unit text convention.

How to use the tool and how it works

  1. Enter exponent, exponents, prefixes. Keep parallel arrays aligned. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read prefix, matched. Inspect matched before interpreting the associated values.

Require aligned exponent/prefix lists with unique exponents. Look up the supplied exponent exactly; return its prefix or empty text with matched false.1

Input fieldMeaning and unitsAccepted input
exponentExponentRequired. Safe integer.
exponentsExponentsRequired. Array of safe integer; maximum items 256.
prefixesPrefixesRequired. Array of text; maximum UTF-16 length 8192; maximum items 256.
Output fieldInterpretationReturned shape
prefixMapped prefix or empty placeholder; inspect matched because a mapped prefix may also be empty.Required. Text; maximum UTF-16 length 8192.
matchedMatchedRequired. Boolean.
json
{
  "input": {
    "exponent": 3,
    "exponents": [
      -3,
      0,
      3
    ],
    "prefixes": [
      "m",
      "",
      "k"
    ]
  },
  "output": {
    "prefix": "k",
    "matched": true
  }
}

Limitations and assumptions

  • The caller supplies the mapping; SI prefixes are not built in or validated. A known mapping can also have empty prefix, so inspect matched.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
  • Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.

Alternative or Complementary methods

Use a unit-aware calculation for actual conversion and dimensional checks. Select a destination-appropriate typography and retain the intended unit meaning when preparing labels.

References

  1. Calculation and input contract: format/engineering-exponent-prefix-choice — tool.io

Similar or alternative tools