Skip to main content

Module figures

Module figures 

Source
Expand description

The numbers check of a report: every number a text states must be one of the facts, as rounded for the text.

Unlike super::check, which reads a chat reply sentence by sentence, this check looks at numbers only and leaves the words to the writer: a report may say anything about the figures, as long as each figure is one of the facts. It reports the numbers that are not, and changes nothing.

  • Rounding: a number matches a fact that rounds to it at the precision it is written with. 13.2% matches 13.19, 13% matches 12.6, 1.2 million matches 1,234,567, but 13.21 does not match 13.2 (a figure more precise than the facts is made up). Tolerance::Exact asks for the value itself.
  • Shares: with ratios_as_percent, 13.19% matches the ratio 0.1319 and 0.13 matches 13%.
  • Notation: 1.234.567 and 1,234,567 are the same number, and so are 13,19 and 13.19. A number that can be read both ways (1.234) matches either reading. Multipliers (15k, 15 rb, 2 jt, 1.5 million, 3 miliar) are applied. Signs are ignored: “down 5%” states the figure -5% as 5%.
  • Words: 0, 1 and 2 written alone are words (“2 stores”), not figures. A digit glued to letters before it (Q3, H1, v2) is a name, not a figure.

Facts are texts, read the same way, or JSON values, whose numbers are taken as they are (a JSON 1.234 is one and a quarter, never a thousand).

Structs§

Figures
The numbers some facts hold.
NumberRules
How numbers are compared.
UnsupportedNumber
A number the facts do not hold, with the sentence it stands in.

Enums§

Tolerance
How close a number must be to a fact.