Skip to content

fix: 价格统一按中文写法显示,货币符号或代码一律在数字前 - #88

Merged
stqfdyr merged 2 commits into
mainfrom
fix/currency-display
Oct 2, 2026
Merged

stqfdyr merged 2 commits into
mainfrom
fix/currency-display

Conversation

@stqfdyr

@stqfdyr stqfdyr commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

面板节点列表的价格改用 Intl.NumberFormat 按 zh-CN 格式化,不再查五个币种的符号表。

  • 符号或代码一律在数字前:HK$38.00、NT$1,999.00;中文里没有符号的写代码,如 SGD 12.50
  • 美元由 $ 改为 US$,与港币、新台币等其它「元」区分开;日元写作 JP¥、整数价格不带 .00,不再和人民币的 ¥ 相同
  • 加千分位:US$12,345.60
  • 小数最多两位,与价格的填写精度一致:日元填 1200.5 显示 JP¥1,200.5,不按日元的整数取整
  • 地区固定为 zh-CN,不随浏览器语言变
  • hub 1.3.1 之前不校验货币,旧数据里不是三个字母的值会让 Intl 抛错,这时照原样显示为 港币 9.90;hub 里「主题不必防抛错」的那句注释同步改正

面板 lint / test / build 与 cargo fmt 通过。浏览器语言设为 en-US,实测 CNY、USD、HKD、JPY、TWD、SGD、EUR 与一条非法旧值,1280 与 390 宽、深浅色下价格都单行显示。

配套 monitor-probe/monitor-theme-default#22、monitor-probe/monitor-theme-serverstatus#20、monitor-probe/monitor-document#35。

Closes #76

@stqfdyr
stqfdyr force-pushed the fix/currency-display branch from d6249ff to 117886a Compare October 2, 2026 10:37
stqfdyr added a commit to monitor-probe/monitor-theme-default that referenced this pull request Oct 2, 2026
节点详情「续费」一栏的价格改用 `Intl.NumberFormat` 按 zh-CN 格式化,不再查五个币种的符号表。

- 符号或代码一律在数字前:`HK$38.00`、`NT$1,999.00`;中文里没有符号的写代码,如 `SGD 12.50`
- 美元由 `$` 改为 `US$`,与港币、新台币等其它「元」区分开;日元写作 `JP¥`、整数价格不带 `.00`,不再和人民币的 `¥` 相同
- 加千分位:`US$12,345.60`
- 小数最多两位,与价格的填写精度一致:日元填 `1200.5` 显示 `JP¥1,200.5`,不按日元的整数取整
- 地区固定为 zh-CN,不随访客的浏览器语言变
- hub 1.3.1 之前不校验货币,旧数据里不是三个字母的值会让 `Intl` 抛错,这时照原样显示为 `港币 9.90`

lint / test / build 通过,`format.test.ts` 加了对应检查。浏览器语言设为 en-US 实测,1280 与 390 宽、深浅色下价格都单行显示,非法旧值不报错。

配套 monitor-probe/monitor#88
stqfdyr added a commit to monitor-probe/monitor-theme-serverstatus that referenced this pull request Oct 2, 2026
展开行「续费」一栏的价格改用 `Intl.NumberFormat` 按 zh-CN 格式化,不再查五个币种的符号表。

- 符号或代码一律在数字前:`HK$38.00`、`NT$1,999.00`;中文里没有符号的写代码,如 `SGD 12.50`
- 美元由 `$` 改为 `US$`,与港币、新台币等其它「元」区分开;日元写作 `JP¥`、整数价格不带 `.00`,不再和人民币的 `¥` 相同
- 加千分位:`US$12,345.60`
- 小数最多两位,与价格的填写精度一致:日元填 `1200.5` 显示 `JP¥1,200.5`,不按日元的整数取整
- 地区固定为 zh-CN,不随访客的浏览器语言变
- hub 1.3.1 之前不校验货币,旧数据里不是三个字母的值会让 `Intl` 抛错,这时照原样显示为 `港币 9.90`

lint / test / build 通过,`format.test.ts` 加了对应检查。浏览器语言设为 en-US 实测,1280 与 390 宽、深浅色下价格都单行显示,非法旧值不报错。

配套 monitor-probe/monitor#88
@stqfdyr
stqfdyr merged commit d58fb1e into main Oct 2, 2026
1 check passed
@stqfdyr
stqfdyr deleted the fix/currency-display branch October 2, 2026 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

货币显示不太一致:HKD 显示成「100.00 HKD」,而 CNY / USD 是「¥100.00」/「$100.00」

1 participant