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

  1. 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.
  2. Enter temperatureValue, unit, renderedTemperature, requireDegreeSymbol using the field table and calculation rules, then run the tool.
  3. Read expectedTemperature, matchesExpected. The explanation below defines the units, signs, ordering and any flags or placeholder values.
  4. 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 fieldMeaningValue type; see rules belowRequirement
temperatureValueTemperature valuenumberRequired
unitTemperature unitstring; one of "C", "F"Required
renderedTemperatureRendered temperaturestringRequired
requireDegreeSymbolRequire degree symbolbooleanRequired

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 fieldMeaningValue type
expectedTemperatureExpected temperaturestring
matchesExpectedMatches expected temperatureboolean
json
{
  "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

  1. Temperature Style — tool.io

Similar or alternative tools

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