fix calling number starts at '스물'
This commit is contained in:
parent
92f9794beb
commit
f1f09cc31a
2 changed files with 5 additions and 2 deletions
|
|
@ -1,7 +1,7 @@
|
|||
export default class CallingNumberKorean {
|
||||
// 개, 살 이 붙는 경우 발음법
|
||||
static SecondDigit = [
|
||||
"열", "스물", "서른", "마흔", "쉰",
|
||||
"", "열", "스물", "서른", "마흔", "쉰",
|
||||
"예순", "일흔", "여든", "아흔",
|
||||
]
|
||||
static FirstDigit = [
|
||||
|
|
|
|||
|
|
@ -161,7 +161,10 @@ export function saferKorean(input: string): string {
|
|||
mod = SIPrefix[mod.toLowerCase() as keyof typeof SIPrefix];
|
||||
return `${num} ${mod}바이트 `;
|
||||
})
|
||||
.replace(/(\d+)[ \t\n]*([개살시])/g, (_, num: string, postfix: string)=>{
|
||||
.replace(/([\d.]+)[ \t\n]*([개살시])/g, (_, num: string, postfix: string)=>{
|
||||
if (num.includes(".")) {
|
||||
return num + postfix;
|
||||
}
|
||||
const intNum = parseInt(num)
|
||||
if (CallingNumberKorean.canConvert(intNum)) {
|
||||
return CallingNumberKorean.convert(intNum) + postfix;
|
||||
|
|
|
|||
Loading…
Reference in a new issue