It's a string, but it's a number. Numeric input formatting, done once.
λ¬Έμμ΄μΈλ° μ«μμΈ νλ. μ½€λ§Β·μ»€μΒ·μ λ ¬Β·μμ리 0, ν λ²μ λ.
The generated <span class="numkey-korean"> is unstyled β the
"μ" here comes from CSS ::after. Also a pure function:
toKorean('927483041001') β 9,274μ΅ 8,304λ§ 1,001.
hangul | λ§νλ―μ΄ β μλ΄ λ¬Έκ΅¬ | |
formal | λͺ¨λ μ리μ μΌ β κ³μ½μΒ·μμμ¦ | |
hanja | κ°μμ β μνΒ·μ΄μΒ·μ κΈν |
Markup-only: <input data-numkey data-numkey-korean data-numkey-korean-style="formal">.
The "κΈ β¦ μμ " frame around the number is yours to add β it differs per document.
A Korean draft is left alone while typing (no fight with the IME); blur
converts it β 3λ§5μ² β 35,000. The reading and any
data-numkey-name hidden field see the parsed value even mid-draft.
data-numkey is the on-switch; data-numkey-locale is an option on top
of it that only changes how the value is drawn. The canonical value stays the same.
data-numkeyκ° μ€μμΉ, data-numkey-localeμ κ·Έ μμ
νμ μ΅μ
β μ μ κ°μ κ·Έλλ‘μ
λλ€.
<input data-numkey="2"> <!-- everyone: 1,234,567.89 -->
<input data-numkey="2" data-numkey-locale="auto"> <!-- browser language:
de β 1.234.567,89
ko β 1,234,567.89 -->
<input data-numkey="2" data-numkey-locale="de-DE"> <!-- pinned German -->
<input data-numkey-locale="auto"> <!-- β nothing: no data-numkey -->
<script src="https://cdn.jsdelivr.net/npm/@devslab/numkey"></script> <input data-numkey> <!-- 1,234,567 --> <input data-numkey="2"> <!-- 1,234.56 --> <input data-numkey data-numkey-negative> <!-- minus ok -->
Vue 3 / React adapters and the full API: README. Wrong-keyboard-layout text in the same form? See numkey's sibling kokey.