Description
Compare rounded with original for unchanged, up or down, and flag towardZero only when the absolute magnitude strictly decreases.
Numeric-looking text has both a value and a written form. Signs, decimal places, exponent markers and trailing zeros can carry display information that ordinary numeric conversion discards; formatting a token does not verify its meaning.
Compare rounded with original for unchanged, up or down, and flag towardZero only when the absolute magnitude strictly decreases.
When to use this tool
Use Formatting: Scalar Rounding Direction Label when you need the specified literal representation or text-level numeric diagnostic.
How to use the tool and how it works
- Enter original, rounded. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read result. Expand result to inspect the returned fields.
Compare rounded with original for unchanged, up or down, and flag towardZero only when the absolute magnitude strictly decreases.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| original | Original | Required. Finite number. |
| rounded | Rounded | Required. Finite number. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| result | Object containing the calculated members; expand to inspect the fields below. | Required. Object. |
| result.direction | Direction | Calculated result member: string. |
| result.towardZero | Toward Zero | Calculated result member: boolean. |
{
"input": {
"original": -1.2,
"rounded": -1
},
"output": {
"result": {
"direction": "up",
"towardZero": true
}
}
} Limitations and assumptions
- These are numeric comparisons rather than a rounding implementation or verification that the supplied result follows a particular rounding rule.
- Outputs are nested inside result. 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 locale-aware or destination-specific formatter when broader parsing and presentation rules are needed. Retain original text when lexical precision matters and validate numeric meaning separately.
References
Similar or alternative tools
- Finance: Loan Rounding Interest Carry Cent
Add exactInterest and priorCarry and require total between zero and 1e9.
- Experimental Psychology: Stimulus Frame Duration Rounding
Floor, ceil or nearest-half-up to whole frames and return realized duration and residual.