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

number-formatter-string

v1.0.0

Published

Comprehensive string formatting utilities for numbers, prices, dates and more

Readme

number-formatter-string

npm license downloads size

Библиотека для форматирования чисел, дат и строк с поддержкой локализации /
JavaScript/TypeScript library for formatting numbers, dates and strings with localization support

Разработчики / Developers

| Role / Роль | Name / Имя | GitHub Profile | |--------------------|----------------|----------------| | Team Lead | Vladimir | vladimirplyukhin89 | | Author & Developer | Leonid | miliukovlo | | Developer | Demid | knyazWeb | | Developer | Denis | krylv |

📥 Установка / Installation

npm install number-formatter-string
# или / or
yarn add number-formatter-string

Функционал / Features:

1. formatDateToString(date: Date): string - Форматирование даты в строку / Date to string formatting

const today = new Date();
formatDateToString(today); // "15.11.2023 14:30:00"

2. formatFloatReplaceDot(value: number): string - Замена точки на запятую / Dot to comma replacement

formatFloatReplaceDot(1234.56); // "1234,56"

3. formatLocalPhoneNumber(phone: string | number): string - Форматирование телефона / Phone number formatting

formatLocalPhoneNumber("79001234567"); // "+7 (900) 123-45-67"
formatLocalPhoneNumber(79001234567);  // "+7 (900) 123-45-67"

4. formatNumberToPriceIntl(value: number, options?) - Денежное форматирование / Currency formatting

// По умолчанию RUB / Default RUB
formatNumberToPriceIntl(1500); // "1 500 ₽"

// Доллары США / USD
formatNumberToPriceIntl(1500, { 
  locale: 'en-US', 
  currency: 'USD'
}); // "$1,500"

// Евро с копейками / Euro with cents
formatNumberToPriceIntl(1500.5, {
  locale: 'de-DE',
  currency: 'EUR',
  minFractionDigits: 2,
  maxFractionDigits: 2
}); // "1.500,50 €"

5. formatNumberToPriceString(value: string | number): string - Форматирование с единицами / Unit formatting

formatNumberToPriceString(1500); // "1.50K"
formatNumberToPriceString(2500000); // "2.50M"

6. formatNumberToRoman(num: number): string - Римские цифры / Roman numerals

formatNumberToRoman(1987); // "MCMLXXXVII"
formatNumberToRoman(2023); // "MMXXIII"

7. formatNumberWithSpaces(value, options?) - Разделители тысяч / Thousands separators

formatNumberWithSpaces(1234567); // "1 234 567"
formatNumberWithSpaces(1234567.89, {
  thousands: '.',
  decimal: ',',
  decimals: 2
}); // "1.234.567,89"

8. getNoun(count: number, forms: string[]): string - Склонение существительных / Noun pluralization

// Русский / Russian
getNoun(5, ['слон', 'слона', 'слонов']); // "слонов"
getNoun(1, ['слон', 'слона', 'слонов']); // "слон"

// English
getNoun(5, ['day', 'days', 'days']); // "days"
getNoun(1, ['day', 'days', 'days']); // "day"