NumToText icon indicating copy to clipboard operation
NumToText copied to clipboard

Reizēm nepareizi (uz leju) apaļojas santīmi

Open arcijsg opened this issue 13 years ago • 1 comments

Piemēram,

PriceToText(8.70, $currencies['LV']['LVL'], 'LV', false, true)

Atgriež: "astoņi lati sešdesmit deviņi santīmi"

PriceToText(69.60, $currencies['LV']['LVL'], 'LV', true, true)

Atgriež: "sešdesmit deviņi lati 59 santīmi"

Man palīdzēja:

noapaļot frakciju, pirms konvertēt float par int:

NumToText.php 73.rindiņā:

        $part_decimal = (int) round((abs($int)*100 - floor(abs($int))*100));

Par manu sistēmu: Linux 2.6.32-50-generic-pae #112-Ubuntu SMP Tue Jul 9 20:44:31 UTC 2013 i686 GNU/Linux

php -v

PHP 5.4.17RC1 (cli) (built: Jun 22 2013 06:32:57) 
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies

arcijsg avatar Dec 03 '13 15:12 arcijsg

Salabots

ivanovsaleksejs avatar Dec 04 '13 11:12 ivanovsaleksejs