新增模块

This commit is contained in:
2026-10-18 15:27:02 +08:00
parent 5b7d1e8f64
commit f2e6d2b3f1
228 changed files with 46089 additions and 11 deletions
+10
View File
@@ -0,0 +1,10 @@
/** 展示格式化:金额统一存元,展示时转千分位 / 万 */
export function yuan(n: number): string {
return n.toLocaleString("zh-CN");
}
export function wan(n: number): string {
return (n / 10_000).toLocaleString("zh-CN", { maximumFractionDigits: 2 });
}
export function pct(rate: number, digits = 0): string {
return `${(rate * 100).toFixed(digits)}%`;
}