Skip to content

Commit

Permalink
chore(Docs): Updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
seebeen committed Apr 26, 2024
1 parent 5ff0348 commit 5d7b7fe
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 14 deletions.
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
<?php

require 'vendor/autoload.php';

$number = '12721438261';
use Oblak\Intl\NumberSerbianizer;
use Oblak\Intl\NumberScale;

require 'vendor/autoload.php';

```
$srn = new NumberSerbianizer();

### Output
echo $srn->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
```
40 changes: 40 additions & 0 deletions README.sr.md
Original file line number Diff line number Diff line change
@@ -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
<?php

use Oblak\Intl\NumberSerbianizer;
use Oblak\Intl\NumberScale;

require 'vendor/autoload.php';

$srn = new NumberSerbianizer();

echo $srn->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
```

0 comments on commit 5d7b7fe

Please sign in to comment.