yaejunyang/packages/utils/floatKorean.ts
2026-02-09 18:31:56 +00:00

16 lines
No EOL
480 B
TypeScript

export default class FloatKorean {
static Digits = [
"영", "일", "이", "삼", "사", "오", "육", "칠", "팔", "구"
];
static convert(num: string): string {
const buf = new Array(num.length);
for (let idx = 0; idx < num.length; idx++) {
if (num[idx] == ".") {
buf[idx] = "쩜";
} else {
buf[idx] = this.Digits[+num[idx]];
}
}
return buf.join("");
}
}