Numeral with Percent Units

This rule enforces the use of numerals (like "5%") instead of spelled-out numbers with the word "percent" (like "five percent") in text. The rule aligns with Microsoft's style guidelines for number formatting, which promotes consistency and readability in technical documentation.

The motivation behind this rule is to ensure numerical values are presented in a clear, consistent, and scannable format. Using numerals with the percent symbol is more concise and makes it easier for readers to quickly grasp numerical information, especially in technical or data-heavy content.

Examples:

Flags these incorrect usages:

  • "twenty percent"
  • "five percent"
  • "fifty percent"

Should be written as:

  • "20%"
  • "5%"
  • "50%"

The rule uses a regular expression to detect spelled-out numbers followed by the word "percent" and flags them as errors.

Rule Source

This rule comes from: https://github.com/mesosphere/dcos-docs-site

Rule Definition

extends: existence
message: "Use a numeral plus the units."
link: https://docs.microsoft.com/en-us/style-guide/numbers
nonword: true
level: error
tokens:
  - '\b[a-zA-z]+\spercent\b'