From 5d7b7fe295a8594a8dda5a5c33a182d2191bc849 Mon Sep 17 00:00:00 2001 From: Sibin Grasic Date: Fri, 26 Apr 2024 05:15:54 +0200 Subject: [PATCH] chore(Docs): Updated docs --- README.md | 28 ++++++++++++++-------------- README.sr.md | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 14 deletions(-) create mode 100644 README.sr.md diff --git a/README.md b/README.md index cd167cc..4f1f758 100644 --- a/README.md +++ b/README.md @@ -1,37 +1,37 @@ -# NumberSerbianizer: Simple class to convert numbers to Serbian Words +# oblak/number-serbianisation [![Readme EN](https://img.shields.io/badge/Readme-English-red)](https://github.com/oblakstudio/number-serbianisation/blob/master/README.md) [![Readme SR](https://img.shields.io/badge/Readme-Serbian-blue)](https://github.com/oblakstudio/number-serbianisation/blob/master/README.sr.md) [![Packagist Version](https://img.shields.io/packagist/v/oblak/number-serbianisation)](https://packagist.org/packages/oblak/number-serbianisation) ![Packagist Dependency Version](https://img.shields.io/packagist/dependency-v/oblak/number-serbianisation/php) [![codecov](https://codecov.io/gh/oblakstudio/number-serbianisation/graph/badge.svg?token=RoeLb6hV76)](https://codecov.io/gh/oblakstudio/number-serbianisation) [![semantic-release: angular](https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release) -## About -NumberSerbianizer is an easy-to-use class for PHP. -It was made to be a class that you could quickly include into a project and have working right away. + ## Installation +You can install the package via composer: ```bash composer require oblak/number-serbianisation ``` -## Basic Usage +## Usage -``` php +```php toWordString(1000); // jedna hiljada +echo $srn->useAccusative()->toWordString(1000); // hiljadu -``` -dvanaest milijardi sedamsto dvadeset jedan milion cetristo trideset osam hiljada dvesta sezdeset jedan -dvadeset tri hiljade osamsto trideset jedan +echo $srn->useScale(NumberScale::Short)->toWordString(1000000000); // jedan bilion +echo $srn->useScale(NumberScale::Long)->toWordString(1000000000); // jedna milijarda +echo $srn->useAccusative()->toWordString(1000000000); // milijardu ``` diff --git a/README.sr.md b/README.sr.md new file mode 100644 index 0000000..fb07b66 --- /dev/null +++ b/README.sr.md @@ -0,0 +1,40 @@ +# oblak/number-serbianisation [![Readme EN](https://img.shields.io/badge/Readme-English-red)](https://github.com/oblakstudio/number-serbianisation/blob/master/README.md) [![Readme SR](https://img.shields.io/badge/Readme-Serbian-blue)](https://github.com/oblakstudio/number-serbianisation/blob/master/README.sr.md) + +[![Packagist Version](https://img.shields.io/packagist/v/oblak/number-serbianisation)](https://packagist.org/packages/oblak/number-serbianisation) +![Packagist Dependency Version](https://img.shields.io/packagist/dependency-v/oblak/number-serbianisation/php) +[![codecov](https://codecov.io/gh/oblakstudio/number-serbianisation/graph/badge.svg?token=RoeLb6hV76)](https://codecov.io/gh/oblakstudio/number-serbianisation) +[![semantic-release: angular](https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release) + +Omogućava konverziju brojeva u tekst na srpskom jeziku - odnosno "posrbljavanje" brojeve. + +## Instalacija + +Biblioteku možete instalirati koristeći composer: + +```bash +composer require oblak/number-serbianisation +``` + +## Upotreba + +Biblioteka podržava dva načina skaliranja brojeva "kratki" i "dugi" (eng. short, long) kao i upotrebu "[skamenjenog akuzativa](https://www.nin.rs/arhiva/vesti/29972/skamenjeni-brojevi)" prilikom konverzije. + + +```php +toWordString(1000); // jedna hiljada +echo $srn->useAccusative()->toWordString(1000); // hiljadu + +echo $srn->useScale(NumberScale::Short)->toWordString(1000000000); // jedan bilion +echo $srn->useScale(NumberScale::Long)->toWordString(1000000000); // jedna milijarda +echo $srn->useAccusative()->toWordString(1000000000); // milijardu +``` +