Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@greenlabs/re-korean-numeral

green-labs19MITdeprecated0.1.2

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

ReScript module to convert the number to Korean

ReScript, ReasonML, BuckleScript

readme

re-korean-numeral

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

1234 -> 1,234
1234567890 -> 123,4567,890
1234567890 -> 123,456// 만 이하 절삭

설치하기

  1. 모듈 설치
npm i @greenlabs/re-korean-numeral
or
yarn add @greenlabs/re-korean-numeral
  1. bsconfig.json 의존성 추가하기
"bs-dependencies": [
  "@greenlabs/re-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