Add more unit convertion

This commit is contained in:
kimpure 2026-05-21 13:46:07 +00:00
parent 4a6eea1900
commit 2e6483a36e
No known key found for this signature in database

View file

@ -163,7 +163,7 @@ export function saferKorean(input: string): string {
mod = SIPrefix[mod.toLowerCase() as keyof typeof SIPrefix]; mod = SIPrefix[mod.toLowerCase() as keyof typeof SIPrefix];
return `${num} ${mod}바이트 `; return `${num} ${mod}바이트 `;
}) })
.replace(/([\d.]+)[ \t\n]*([개살시])/g, (_, num: string, postfix: string)=>{ .replace(/([\d.]+)[ \t\n]*([개살시평명])/g, (_, num: string, postfix: string)=>{
if (num.includes(".")) { if (num.includes(".")) {
return num + postfix; return num + postfix;
} }
@ -209,5 +209,7 @@ export function saferKorean(input: string): string {
.replace(/[\%\^\&\*\#\@\.\-\+\_\=\/\\♡\$]/g, (t) => ( .replace(/[\%\^\&\*\#\@\.\-\+\_\=\/\\♡\$]/g, (t) => (
SymbolMap[t as keyof typeof SymbolMap] SymbolMap[t as keyof typeof SymbolMap]
)) ))
.replace(/㎡/g, "제곱미터")
.replace(/㎢/g, "제곱킬로미터")
.replace(/([\?\!]+)/g, (_, content: string) => content[0]) .replace(/([\?\!]+)/g, (_, content: string) => content[0])
} }