@rbuljan/eur2hr

1.1.0 • Public • Published

EUR 2 HR - Convert EURO (€) value to Croatian words (višerječnice)

Useful when in need to show the money amount in words like i.e:

Iznos: 121024.05 €
Slovima: stodvadesetjednatisućadvadesetčetiri eura i pet centi

Install

npm i @rbuljan/eur2hr

Usage

import eur2hr from "@rbuljan/eur2hr";
const words = eur2hr(1042.31);

console.log(words);

jednatisućačetrdesetdva eura i tridesetjedan cent

import eur2hr from "@rbuljan/eur2hr";
const words = eur2hr(1042.31, { simple: true });

tisućučetrdesetdva eura i tridesetjedan cent

import eur2hr from "@rbuljan/eur2hr";
const words = eur2hr(1042.31, { simple: true, delimiter: " " });

tisuću četrdeset dva eura i trideset jedan cent

Syntax

eur2hr(number [, {options}])

Returns a String, with the the Croatian representation of money as words.
Returns String "Error" if the input number is greater than 1e13 (10_000_000_000_000.00)

Arguments

number (String|Number)

number is a float String or Number

options (Object)

Property Type Default Description
delimiter String "" Use i.e. " " to delimit words with space
simple Boolean false Set to true to remove unnecessary "jedan/na" for round thousands numbers

Test

To create a readable test.txt file with your test results, edit the test.js variables and run:

node test  # Find the results in ./test.txt

Licence

MIT

Package Sidebar

Install

npm i @rbuljan/eur2hr

Weekly Downloads

1

Version

1.1.0

License

MIT

Unpacked Size

11.9 kB

Total Files

5

Last publish

Collaborators

  • rbuljan