1.0.0 • Published 1 year ago

numero-a-texto v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Description

Simple process in order to translate numbers to texts using spanish rules on cardinal numbering.

Process considers forms 'apocopate' (apocopado) and gender using options provided to translate method.

Restrictions

  • Number to translate is using only integer part in order to translate.
  • Compatible for numbers between 0 ... 999.999.999.999 (1 billion - 1)

Next versions

  • Simplify translate process
  • Decimal parts
  • Automatic pluralization

Installation

npm install --save numero-a-texto

Uso

const numToText = require('numero-a-texto')

numToText.translate(154821)
# Numéric form
# 'Ciento cincuenta y cuatro mil ochocientos veintiuno'

numToText.translate(154821, { suffix: 'pesos'})
# Cardinal
# 'Ciento cincuenta y cuatro mil ochocientos veintiún pesos'

numToText.translate(154821, { suffix:'personas', gender: 'F' })
# Cardinal using female gender
# 'Ciento cincuenta y cuatro mil ochocientas veintiuna personas'
1.0.0

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago