Skip to main content

Convert Vietnamese numbers to words

Project description

vnnum2word

Convert numbers to words, with a focus on the Vietnamese language.

This project is inspired by (num2words)[https://github.com/savoirfairelinux/num2words].

The original (num2words)[https://github.com/savoirfairelinux/num2words] library formats numbers into floats with two decimal places. For example:

from num2words import num2words
num2words(12.5, lang='vi')
# mười hai phẩy năm mươi
num2words(12.556, lang='vi')
# mười hai phẩy năm mươi sáu

However, in Vietnamese, these results are often inaccurate or unnatural. This package fixes those issues and provides more accurate and natural outputs for Vietnamese numbers.

Installation

pip install vnnum2word

Usage

from vnnum2word import WordConverter
converter=WordConverter()
converter(12.5)
# mười hai phẩy năm

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vnnum2word-0.2.0.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vnnum2word-0.2.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file vnnum2word-0.2.0.tar.gz.

File metadata

  • Download URL: vnnum2word-0.2.0.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.11

File hashes

Hashes for vnnum2word-0.2.0.tar.gz
Algorithm Hash digest
SHA256 742f21c9d36cb301580ca4cc973dfe1a32f6f15471cb89c85b4bae10f97e7440
MD5 f7f196013d144b62e1cec867907b6897
BLAKE2b-256 b950618af4f4aaf6a07338e18892b95a8b8ed54385009cd2644c300dc4016a07

See more details on using hashes here.

File details

Details for the file vnnum2word-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: vnnum2word-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.11

File hashes

Hashes for vnnum2word-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1f054dbc9417dee07b2816a9843411cb46c74e5a4686fb32d228fc49058f8269
MD5 0b2949216352399a3e08341dc5f89d6c
BLAKE2b-256 502141f048f7d4cb99207b87847246df7f1d52b350c104e4c0957320589e4a1c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page