Temperature Style
Validate a rendered temperature against supplied unit and degree-symbol policy.
Description
A temperature style check compares a supplied rendering with a constructed number-and-unit string.
A temperature style check compares a supplied rendering with a constructed number-and-unit string. The degree-symbol choice controls the expected spacing.1
Validate a rendered temperature against supplied unit and degree-symbol policy.
When to use Temperature Style
Use this tool to validate a rendered temperature against supplied unit and degree-symbol policy.
Prepare the text, recorded observations, aligned figures or editorial criteria requested. Confirm what each label, count, timestamp or supplied flag represents before interpreting the result.
How to use Temperature Style and understand its results
- Prepare the text, recorded observations, aligned figures or editorial criteria requested. Confirm what each label, count, timestamp or supplied flag represents before interpreting the result.
- Enter temperatureValue, unit, renderedTemperature, requireDegreeSymbol using the field table and calculation rules, then run the tool.
- Read expectedTemperature, matchesExpected. The explanation below defines the units, signs, ordering and any flags or placeholder values.
- If the tool reports an input issue, correct the values and run it again. Apply the stated assumptions when interpreting a successfully returned result.
| Input field | Meaning | Value type; see rules below | Requirement |
|---|---|---|---|
| temperatureValue | Temperature value | number | Required |
| unit | Temperature unit | string; one of "C", "F" | Required |
| renderedTemperature | Rendered temperature | string | Required |
| requireDegreeSymbol | Require degree symbol | boolean | Required |
Enter finite temperature, unit C or F, the degree-symbol flag and rendered text. Trim the rendering and compare it exactly with the expected string; return both.
expected=number+°+unit, or number+space+unit Units, indexing, boundary conditions and exceptional cases are defined in the calculation rules above.
| Output field | Meaning | Value type |
|---|---|---|
| expectedTemperature | Expected temperature | string |
| matchesExpected | Matches expected temperature | boolean |
{
"input": {
"temperatureValue": 72,
"unit": "F",
"renderedTemperature": "72°F",
"requireDegreeSymbol": true
},
"output": {
"expectedTemperature": "72°F",
"matchesExpected": true
}
} Limitations and assumptions
No Celsius/Fahrenheit conversion, rounding rule or case-insensitive matching is performed.
Numeric inputs must be finite. Follow the calculation-specific rules for overflow, underflow and exceptional cases. Extremely large text inputs are rejected. Missing required fields, extra fields, wrong value types and violations of the calculation rules are input errors. A successfully returned false flag is an evaluated outcome; its meaning is explained above.
Alternative or Complementary methods
Use Percent Range Style: Validate percentage-range punctuation and repeated percent signs. For a complementary task, use Dollar Figure Style: Validate dollar-figure grouping and decimal precision.
References
-
Temperature Style — tool.io
Similar or alternative tools
- Percent Range Style
Validate percentage-range punctuation and repeated percent signs.
- Dollar Figure Style
Validate dollar-figure grouping and decimal precision.