npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

num2words-uz

v1.0.1

Published

Convert numbers into words in Uzbek (Latin & Cyrillic), Russian and English, with currency support for som (UZS), dollar (USD), ruble (RUB) and euro (EUR).

Readme

num2words-uz

A lightweight, dependency-free TypeScript library that converts numbers into words in Uzbek (Latin & Cyrillic), Russian and English — with built-in currency support for som, dollar, ruble and euro.

🔢 ➡️ 🔡

1500.5  ➡  bir ming besh yuz so'm ellik tiyin
25.5    ➡  yigirma besh dollar ellik sent
1234    ➡  bir ming ikki yuz o'ttiz to'rt

Features

  • 🇺🇿 Uzbek — both Latin (uz) and Cyrillic (uz-cyrl) scripts
  • 🇷🇺 Russian (ru) — correct grammatical gender and plural forms (один рубль, две копейки, пять рублей)
  • 🇬🇧 English (en)
  • 💵 Currencies — som (UZS), dollar (USD), ruble (RUB), euro (EUR), plus your own
  • 🪙 Subunits — tiyin / cent / kopek, derived from the fractional part
  • 📦 ESM + CommonJS + type declarations — framework-agnostic: works out of the box in React, Next.js, Vue, Nuxt, Svelte, Angular, Node and the browser
  • 🖥️ SSR-safe — no browser APIs, no side effects
  • 🌳 Zero dependencies, tree-shakeable
  • ✅ Fully covered by unit tests

Installation

npm install num2words-uz
# or
yarn add num2words-uz
# or
pnpm add num2words-uz

Usage

import { numberToWords, somToWords, currencyToWords } from 'num2words-uz';

// Plain numbers
numberToWords(1234);            // "bir ming ikki yuz o'ttiz to'rt"
numberToWords(1234, 'uz-cyrl'); // "бир минг икки юз ўттиз тўрт"
numberToWords(1234, 'ru');      // "одна тысяча двести тридцать четыре"
numberToWords(1234, 'en');      // "one thousand two hundred thirty-four"

// Uzbek som (UZS)
somToWords(1500.5);                    // "bir ming besh yuz so'm ellik tiyin"
somToWords(1500);                      // "bir ming besh yuz so'm"
somToWords(1500, { lang: 'uz-cyrl' }); // "бир минг беш юз сўм"

// Other currencies
currencyToWords(25.5, { currency: 'usd' });               // "yigirma besh dollar ellik sent"
currencyToWords(150, { currency: 'rub' });                // "yuz ellik rubl"
currencyToWords(10.25, { currency: 'eur' });              // "o'n yevro yigirma besh sent"
currencyToWords(1.01, { currency: 'rub', lang: 'ru' });   // "один рубль одна копейка"

With CommonJS:

const { somToWords } = require('num2words-uz');
somToWords(99.99); // "to'qson to'qqiz so'm to'qson to'qqiz tiyin"

Framework usage

The library is plain TypeScript with no dependencies, so it works the same in every framework — and it is safe to call during server-side rendering.

React / Next.js

import { somToWords } from 'num2words-uz';

export function AmountInWords({ amount }: { amount: number }) {
  return <p>{somToWords(amount, { capitalize: true })}</p>;
}

// <AmountInWords amount={1500000} />
// => "Bir million besh yuz ming so'm"

Vue / Nuxt

<script setup lang="ts">
import { computed } from 'vue';
import { somToWords } from 'num2words-uz';

const props = defineProps<{ amount: number }>();
const inWords = computed(() => somToWords(props.amount, { capitalize: true }));
</script>

<template>
  <p>{{ inWords }}</p>
</template>

<!-- <AmountInWords :amount="1500000" /> -->
<!-- => "Bir million besh yuz ming so'm" -->

Nuxt needs no extra configuration — the package ships both ESM and CommonJS builds, so it does not have to be added to build.transpile.

Node / plain JavaScript

const { somToWords } = require('num2words-uz');

console.log(somToWords(1500000, { capitalize: true }));
// "Bir million besh yuz ming so'm"

API

numberToWords(value, lang?)

Converts an integer into words. The fractional part is rounded.

| Parameter | Type | Default | Description | | --- | --- | --- | --- | | value | number \| string | — | The number to convert | | lang | 'uz' \| 'uz-cyrl' \| 'ru' \| 'en' | 'uz' | Output language |

Negative values are prefixed with minus (минус in Russian and Uzbek Cyrillic).

currencyToWords(amount, options?)

Converts a monetary amount into words. The fractional part becomes subunits (tiyin / cent / kopek).

| Option | Type | Default | Description | | --- | --- | --- | --- | | currency | 'uzs' \| 'usd' \| 'rub' \| 'eur' \| CurrencyDef | 'uzs' | Currency code or a custom definition | | lang | Lang | 'uz' | Output language | | showSub | boolean | true | Include the subunit | | alwaysShowSub | boolean | false | Include the subunit even when it is zero | | capitalize | boolean | false | Capitalize the first letter |

somToWords(amount, options?)

Convenience wrapper around currencyToWords with currency: 'uzs'. Options: lang, showTiyin, alwaysShowTiyin, capitalize.

somToWords(1500.5, { showTiyin: false });      // "bir ming besh yuz so'm"
somToWords(1500, { alwaysShowTiyin: true });   // "bir ming besh yuz so'm nol tiyin"
somToWords(1234, { capitalize: true });        // "Bir ming ikki yuz o'ttiz to'rt so'm"

Custom currencies

import { currencyToWords, CurrencyDef } from 'num2words-uz';

const gbp: CurrencyDef = {
  main: { uz: 'funt', 'uz-cyrl': 'фунт', ru: ['фунт', 'фунта', 'фунтов'], ruGender: 0, en: ['pound', 'pounds'] },
  sub:  { uz: 'pens', 'uz-cyrl': 'пенс', ru: ['пенс', 'пенса', 'пенсов'], ruGender: 0, en: ['penny', 'pence'] },
  subInMain: 100,
};

currencyToWords(5.5, { currency: gbp, lang: 'uz' }); // "besh funt ellik pens"

ruGender0 for masculine (один), 1 for feminine (одна). Required so Russian numerals agree with the noun.

Limitations

  • Supports values up to one quadrillion (within JavaScript's number range).
  • In the currency helpers the fractional part is treated as subunits (max 2 decimal places).

License

MIT