numbers

package
v0.0.0-...-03703b6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 1, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func DigitList

func DigitList(n int) []int

DigitList returns a list of digits of the number n. The result starts with the most significant digit.

Example
digits := DigitList(1234567890)
fmt.Println(digits)
Output:

[1 2 3 4 5 6 7 8 9 0]

func DigitToString1

func DigitToString1(n int) string

DigitToString1 returns a german string representation of the number n as it would appear in the 1 digit.

Example
fmt.Println(DigitToString1(0))
fmt.Println(DigitToString1(1))
fmt.Println(DigitToString1(2))
fmt.Println(DigitToString1(3))
fmt.Println(DigitToString1(4))
fmt.Println(DigitToString1(5))
fmt.Println(DigitToString1(6))
fmt.Println(DigitToString1(7))
fmt.Println(DigitToString1(8))
fmt.Println(DigitToString1(9))
Output:


einund
zweiund
dreiund
vierund
fünfund
sechsund
siebenund
achtund
neunund

func DigitToString10

func DigitToString10(n int) string

DigitToString10 returns a german string representation of the number n as it would appear in the 10 digit.

Example
fmt.Println(DigitToString10(0))
fmt.Println(DigitToString10(1))
fmt.Println(DigitToString10(2))
fmt.Println(DigitToString10(3))
fmt.Println(DigitToString10(4))
fmt.Println(DigitToString10(5))
fmt.Println(DigitToString10(6))
fmt.Println(DigitToString10(7))
fmt.Println(DigitToString10(8))
fmt.Println(DigitToString10(9))
Output:


zehn
zwanzig
dreißig
vierzig
fünfzig
sechzig
siebzig
achtzig
neunzig

func DigitToString100

func DigitToString100(n int) string

DigitToString100 returns a german string representation of the number n as it would appear in the 100 digit.

Example
fmt.Println(DigitToString100(0))
fmt.Println(DigitToString100(1))
fmt.Println(DigitToString100(2))
fmt.Println(DigitToString100(3))
fmt.Println(DigitToString100(4))
fmt.Println(DigitToString100(5))
fmt.Println(DigitToString100(6))
fmt.Println(DigitToString100(7))
fmt.Println(DigitToString100(8))
fmt.Println(DigitToString100(9))
Output:


einhundert
zweihundert
dreihundert
vierhundert
fünfhundert
sechshundert
siebenhundert
achthundert
neunhundert

func NumberToString

func NumberToString(n int) string

NumberToString returns a german string representation of the number n.

Example (Special)
fmt.Println(NumberToString(1))
fmt.Println(NumberToString(2))
fmt.Println(NumberToString(3))
fmt.Println(NumberToString(9))
fmt.Println(NumberToString(22))
fmt.Println(NumberToString(23))
fmt.Println(NumberToString(99))
fmt.Println(NumberToString(113))
Output:

eins
zwei
drei
neun
zweiundzwanzig
dreiundzwanzig
neunundneunzig
einhundertdreizehn

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL