feat: migrate app routes and business modules

This commit is contained in:
2026-08-12 18:22:59 +08:00
parent 555aa00043
commit cc706378c2
247 changed files with 28623 additions and 14988 deletions
+14
View File
@@ -0,0 +1,14 @@
export const parseMoneyToCents = (amount) => {
const amountParts = String(amount || "").match(/^(\d+)(?:\.(\d{1,2}))?$/);
if (!amountParts) return null;
return (
BigInt(amountParts[1]) * 100n +
BigInt((amountParts[2] || "").padEnd(2, "0"))
);
};
export const formatSignedMoney = (amount) => {
const normalizedAmount = String(amount);
const sign = normalizedAmount.startsWith("-") ? "-" : "+";
return `${sign}¥${normalizedAmount.replace(/^-/, "")}`;
};