Skip to content

Main content

Decimal Scale Alignment Zero Count Tool

Compute decimal scale alignment zero count from explicit bounded inputs.

Loading tool…

Description

For leftScale and rightScale in 0..128 return commonScale=max(scales), leftZeros=common-leftScale, and rightZeros=common-rightScale.

Decimal rounding and scale alignment depend on retained places, discarded digits, tie rules, and the number of rounding stages. A decimal spacing is different from the binary floating-point spacing of a runtime number. Text-based digit operations can preserve widths that disappear when a value is parsed numerically.

For leftScale and rightScale in 0..128 return commonScale=max(scales), leftZeros=common-leftScale, and rightZeros=common-rightScale.

When to use this tool

Use Decimal Scale Alignment Zero Count when you need this specific decimal tie, scale, digit-carry, spacing, or staged-rounding check.

How to use the tool and how it works

  1. Enter leftScale, rightScale. 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 commonScale, leftZeros, rightZeros. Use the output convention below.

For leftScale and rightScale in 0..128 return commonScale=max(scales), leftZeros=common-leftScale, and rightZeros=common-rightScale.1

Input fieldMeaning and unitsAccepted input
leftScaleLeft ScaleRequired. Safe integer; minimum 0; maximum 128.
rightScaleRight ScaleRequired. Safe integer; minimum 0; maximum 128.
Output fieldInterpretationReturned shape
commonScaleCommon ScaleRequired. Safe integer.
leftZerosLeft ZerosRequired. Safe integer.
rightZerosRight ZerosRequired. Safe integer.
json
{
  "input": {
    "leftScale": 2,
    "rightScale": 5
  },
  "output": {
    "commonScale": 5,
    "leftZeros": 3,
    "rightZeros": 0
  }
}

Limitations and assumptions

  • Scales are supplied nonnegative decimal places. This budgets coefficient zero-padding to a common scale without parsing coefficients, changing values, adding numbers, or choosing a display format.
  • 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 an exact decimal representation when binary floating-point rounding is inadequate. Apply a complete rounding rule rather than treating a tie-only flag or digit-count term as the whole decision.

References

  1. Calculation and input contract: number/decimal-scale-alignment-zero-count — tool.io

Similar or alternative tools