Grid Reference Digit Padding Normalizer

Left-pad explicitly interpreted local coordinate integers; does not append precision digits or infer a full grid square.

Description

Left-pad local easting and northing digit strings to a chosen width.

Grid components sometimes need a consistent written width for storage or display. This normalizer left-pads separately supplied easting and northing digit strings with zeros.

When to use this tool

Left-pad local easting and northing digit strings to a chosen width. Use it when the input measurements and conventions below match the operation you need.

  • Prepare eastingDigits, northingDigits, targetDigitsPerAxis, respecting the measurement basis and boundaries below.
  • Compare the worked example with your intended operation before reusing its result.

How to use the tool and how it works

  1. Enter every field in the input table using the stated units and exact supported selector spelling where applicable.
  2. Run the tool. Correct input errors before interpreting an output.
  3. Read the result fields below; use accompanying flags and the stated sign, boundary or model convention when interpreting a number.

targetDigitsPerAxis must be an integer from 1 to 5. Each component must contain digits and be no longer than that width; padStart adds leading zeros until the target width is reached.1

Input fieldMeaning and unitsAccepted input
eastingDigitsEasting digits.Text
northingDigitsNorthing digits.Text
targetDigitsPerAxisTarget digits per axis.Integer; from 1 to 5 inclusive
Output fieldInterpretation
resultObject containing the following named result fields.
result.normalizedEastingNormalized easting; use the stated units and sign convention.
result.normalizedNorthingNormalized northing; use the stated units and sign convention.
json
{
  "input": {
    "eastingDigits": "12",
    "northingDigits": "3",
    "targetDigitsPerAxis": 3
  },
  "output": {
    "result": {
      "normalizedEasting": "012",
      "normalizedNorthing": "003"
    }
  }
}

Limitations and assumptions

  • Padding is textual formatting, not a precision conversion or an accuracy improvement. It does not append trailing zeros, truncate longer coordinates or locate the referenced grid square.
  • Every declared field is required and unexpected fields are rejected. Numeric inputs must be finite; input errors are distinct from a valid false result or an explicitly qualified output.
  • Extremely large inputs and nonfinite or excessively large outputs are rejected. List positions reported by the tool use zero-based indices unless stated otherwise.

Alternative or Complementary methods

For a map-layout decision, inspect the rendered map at its intended size as well as its numerical dimensions. For classification or coordinate work, retain the chosen boundary and coordinate conventions with the result. Compare the scope of the nearby tools below before substituting one.

References

  1. Tool behavior and example: Grid Reference Digit Padding Normalizer — tool.io

Similar or alternative tools

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies