0.4.0 • Published 1 month ago

@greenlabs/rescript-korean-numeral v0.4.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

rescript-korean-numeral

npm version

@greenlabs/re-korean-numeral은 deprecated 되었습니다. 새로운 패키지명 @greenlabs/rescript-korean-numeral을 이용해서 설치해주세요.

rescript-korean-numeral은 숫자를 한글 숫자로 변환해주는 리스트립트(ReScript) 모듈 입니다.

1234 -> 1,234
1234567890 -> 12억 3,456만 7,890
1234567890 -> 12억 3,456만  // 만 이하 절삭

설치하기

  1. 모듈 설치
npm i @greenlabs/rescript-korean-numeral
or
yarn add @greenlabs/rescript-korean-numeral
  1. bsconfig.json 의존성 추가하기
"bs-dependencies": [
  "@greenlabs/rescript-korean-numeral"
]

사용방법

  1. fromInt
KoreanNumeric.fromInt(1234, ())
// 1,234
  1. fromFloat
KoreanNumeric.fromFloat(1234567890.1, ~drop=1, ())
// 12억 3,456만
  1. fromString
KoreanNumeric.fromString("1234567890987654321", ~drop=1, ())
// 123경 4,567조 8,909억 8,765만

테스트

npm run test
or
yarn test