numtoword

package module
v0.0.0-...-09e1486 Latest Latest
Warning

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

Go to latest
Published: May 23, 2020 License: MIT Imports: 3 Imported by: 0

README

NumToWord

NumToWord is a simple Golang package for converting a number into its corresponding italian word value.
For example, let's take 10. NumToWord converts it to dieci which means ten.

NumToWord can take numbers up to 12 digits long. You can see a live demo here:
https://cianoscatolo.it/numberToWord?number=YourNumberHere

Basic usage

In this example, you can see the basic usage of this package.

package main

import (
	ntw "github.com/cianoscatolo/numtoword"
	"fmt"
)

func main() {

		num := 256987
		conv, err := ntw.Convert(num)
		if err != nil {
			fmt.Println("Error: "+err.Error())
			return
		}
		fmt.Println(conv)
    
}

Bugs & Optimization

Please, open an issue or DM me on Telegram at @cianoscatolo if you find an issue or a way to optimize the code. It's the first package I have ever created, so every piece of feedback is helpful to me.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Convert

func Convert(n int) (string, error)

Convert transcripts your integer to its Italian word equivalent. It returns error if n is more than 12 digits long. Example: 10 will be dieci, which means ten.

Types

This section is empty.

Jump to

Keyboard shortcuts

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