javadev/moneytostr-russian

The tool to convert amount to words in Ukrainian/English/Russian languages

Installs: 1 163

Dependents: 0

Suggesters: 0

Security: 0

Stars: 40

Watchers: 5

Forks: 23

Open Issues: 0

Language:HTML

v1.22 2024-04-19 04:03 UTC

This package is auto-updated.

Last update: 2024-04-19 04:34:11 UTC


README

Maven Central Java CI CodeQL Coverage Status Known Vulnerabilities

The tool to convert amount to words in Ukrainian/English/Russian languages

Download

Download latest release or grab via Maven:

<dependency>
  <groupId>com.github.javadev</groupId>
  <artifactId>moneytostr</artifactId>
  <version>1.22</version>
</dependency>

or Gradle:

implementation 'com.github.javadev:moneytostr:1.22'

MoneyToStr - Java Class

Class Overview: The MoneyToStr class provides methods to convert numeric values into text representations of currency in various languages.

Dependencies:

  • Java Standard Library

Public Classes:

  • MoneyToStr: Main class for converting numbers to symbols.
  • MoneyToStr.Currency: Enum representing different currencies.
  • MoneyToStr.Language: Enum representing different languages.
  • MoneyToStr.Pennies: Enum representing pennies as numbers or text.

Public Methods:

  • MoneyToStr(Currency currency, Language language, Pennies pennies): Constructor to initialize the MoneyToStr object with currency, language, and pennies.
  • String convert(Double theMoney): Converts a double value to a text description of the money value.
  • String convert(Long theMoney, Long theKopeiki): Converts an amount to words.

Usage Example:

MoneyToStr moneyToStr = new MoneyToStr(Currency.UAH, Language.UKR, Pennies.NUMBER);
String result = moneyToStr.convert(123D);
// Expected: result = сто двадцять три гривні 00 копійок