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 🙏

© 2024 – Pkg Stats / Ryan Hefner

number2vn

v1.0.3

Published

Number to Viet Nam string

Downloads

46

Readme

Chuyển đổi số thành chữ Việt Nam

npm version Build Status Codecov tested with jest GitHub license

  • Không sử dụng thư viện ngoài
  • Test 100% coverage
  • Chỉ ~ 130 loc
  • Nhiều config tùy chọn
number2vn(123456); // hoặc number2vn('123456');
// -> một trăm hai mươi ba nghìn bốn trăm năm mươi sáu

Cài đặt

npm i number2vn --save

Config

  • Bỏ mươi trong hàng chục.
import number2vn from number2vn;
// or const { number2vn } = require('number2vn');
const config = {
  short: true,
};
number2vn(23); // -> hai mươi ba
number2vn(23, config); // -> hai ba
  • Số 4 cuối được chuyển tù bốn thành
const config = {
  short: true,
  four: 'tư',
};
number2vn(14, config); // -> mười bốn
number2vn(24, config); // -> hai tư
number2vn(34, config); // -> ba tư
  • Số 0 ở hàng chục chuyển từ lẻ thành linh
const config = {
  zero: 'linh',
};
number2vn(101); // -> một trăm lẻ một
number2vn(101, config); // -> một trăm linh một
  • Chuyển từ nghìn thành ngàn
const config = {
  thousand: 'ngàn',
};
number2vn(2000, config) // -> hai ngàn
number2vn(2001, config) // -> hai ngàn không trăm lẻ một
  • Số 0 ở hàng trăm có thể bỏ không trăm
const config = {
  short: true,
  thousand: 'ngàn',
  hundredZero: false,
};
number2vn(2001, config) // -> hai ngàn lẻ một
number2vn(2009, config) // -> hai ngàn lẻ chín
number2vn(2020, config) // -> hai ngàn hai mươi
number2vn(2021, config) // -> hai ngàn hai mốt