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

num-words-de

v1.1.0

Published

Convert Num/Int to equivalent String in German Language

Downloads

927

Readme

Convert an number to the equivalent word in the german language.

Zahlen in den das entsprechende Zahlenwort der deutschen Sprache konvertieren

This Package is inspired by https://github.com/salmanm/num-words and extends the idea for the german language.

Note:

  • This package does support typescript

  • This package does not support numbers larger than 12 digits. If a higher number is given it will return the input value.

Install

npm i num-words-de

Example

1 -> Eins
10 -> Zehn
13 -> Dreizehn
1000 -> Eintausend
12345 -> Zwölftausenddreihundertvierundfünfzig
1345000000 -> Eine Milliarde dreihundertfünfundvierzig Millionen

Usage

const numToWordsDe = require('num-words-de')

numToWordsDe.numToWord(1) // eins

or

import {numToWord} from "num-words-de"

numToWord(1) // eins

Parameter

The params are taken within a params-object. The object contains following parameters

{
    uppercase: true,
    indefinite_eine: false,
    indefinite_einer: false,
    indefinite_eines: false,
    indefinite_einem: false,
    indefinite_ein: false
}

uppercase (default true) -> If return string is upper or lowercase

numToWord(10) // Zehn
numToWord(10, {uppercase:false}) // zehn

Due to some special cases with Indefinitivpronomen following cases for the number one are supported. If multiple of these values are true they are taken in the bottom order and the first one will be executed.

indefinite_eine (default false) -> If number one should be converted into eine

indefinite_einer (default false) -> If number one should be converted into einer

indefinite_eines (default false) -> If number one should be converted into eines

indefinite_einem (default false) -> If number one should be converted into einem

indefinite_ein (default false) -> If number one should be converted into ein

numToWord(1) // Eins
numToWord(10, {indefinite_eine:true}) // Zehn
numToWord(1, {indefinite_eine:true}) // Eine
numToWord(1, {indefinite_einer:true}) // Einer
numToWord(1, {indefinite_eines:true}) // Eines
numToWord(1, {indefinite_einem:true}) // Einem
numToWord(1, {indefinite_ein:true}) // Ein
numToWord(1, {indefinite_einem:true, uppercase:false}) // einem

Contributing

If you are able to detect an issue feel free to create an issue. Please add the input value when doing so.