13 lines
542 B
JavaScript
13 lines
542 B
JavaScript
|
|
import test from "node:test";
|
||
|
|
import assert from "node:assert/strict";
|
||
|
|
import { formatTokensZh } from "../src/renderer/displayFormat.js";
|
||
|
|
|
||
|
|
test("formatTokensZh uses Chinese magnitude units instead of western suffixes", () => {
|
||
|
|
assert.equal(formatTokensZh(9999), "9999");
|
||
|
|
assert.equal(formatTokensZh(10_000), "1万");
|
||
|
|
assert.equal(formatTokensZh(71_400), "7.1万");
|
||
|
|
assert.equal(formatTokensZh(6_600_000), "660万");
|
||
|
|
assert.equal(formatTokensZh(196_700_000), "1.97亿");
|
||
|
|
assert.equal(formatTokensZh(1_020_000_000), "10.2亿");
|
||
|
|
});
|