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
npm i @rbuljan/eur2hr
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
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
)
number
is a float String or Number
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 |
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
MIT