Skip to content

Number Format

Noogear edited this page Mar 19, 2026 · 3 revisions

number-format.yml — 数字量化缩写规则

定义数字量化缩写方案,在 indicator/*.yml 中通过 number-format 字段引用。

格式

# 规则名:
#   阈值: 后缀
规则名:
  1000:       "K"
  1000000:    "M"
  1000000000: "B"

当数值达到或超过阈值时使用对应后缀,精度由指示器的 decimal-places 控制。

示例

compact:
  1000:       "K"         # 1234 → "1.2K"
  1000000:    "M"         # 1234567 → "1.2M"
  1000000000: "B"         # 1234567890 → "1.2B"

使用方式

在指示器配置中引用:

default:
  number-format: compact    # 引用上面定义的规则名
  decimal-places: 1          # 保留 1 位小数

后缀字符串(YAML 值)支持嵌入 PAPI 占位符,例如 1000: "%server_name%_K" 将在加载时解析并固定为对应值。

Clone this wiki locally