<?php

namespace Lc\SovBundle\Component;


class NumberComponent
{
    public function round($price, $precision = 2)
    {
        return round((($price * 100)) / 100, $precision);
    }

    public function numberToWord(int $number): string
    {
        $numberWordArray = [
            'zero',
            'one',
            'two',
            'three',
            'four',
            'five',
            'six',
            'seven',
            'eight',
            'nine',
            'ten'
        ];

        if(isset($numberWordArray[$number])) {
            return $numberWordArray[$number];
        }

        return '';
    }
}
