convertor

package
v0.2.5-alpha Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2023 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultOption = NewOptions(currency.RUB, declension.NOMINATIVE, -1,
	true, NumberPart{Fractional: true, Integer: true},
	NumberPart{Fractional: true, Integer: true},
	NumberPart{Fractional: true, Integer: true}, nil)

Functions

func Convert

func Convert(number interface{}, options Options) (string, error)

Convert convertor number into the words representation.

Types

type NumberPart

type NumberPart struct {
	/**
	 * Show fractional part of number\
	 * `true` Два рубля **пять копеек**\
	 * `false` Два рубля\
	 * Default: `true`
	 */
	Fractional bool
	/**
	 * Show integer part of number\
	 * `true` **Два рубля** пять копеек\
	 * `false` Пять копеек\
	 * Default: `true`
	 */
	Integer bool
}

type Options

type Options struct {
	// contains filtered or unexported fields
}

func NewOptions

func NewOptions(currency currency.Currency, declension declension.Declension,
	roundNumber int64, convertMinusSignToWord bool,
	showNumberParts, convertNumberToWords, showCurrency NumberPart,
	currencyInfo *currency.CustomCurrency,
) Options

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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