From b50a7459225a6d7b55bf34a20bcfeb5489360eb5 Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Wed, 8 Feb 2012 01:00:11 +0100 Subject: [PATCH] Rerun of /includes/ui/ui_view.inc --- includes/ui/ui_view.inc | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/includes/ui/ui_view.inc b/includes/ui/ui_view.inc index 00c0cd0c..e366af36 100644 --- a/includes/ui/ui_view.inc +++ b/includes/ui/ui_view.inc @@ -774,14 +774,8 @@ function price_in_words($amount, $document=0) if ($dec > 0) { $divisor = pow(10, $dec); - // algorithm rewritten due to a bug in sprintf (wrong with frac, 29, 57 and more). $frac = round2($amount - floor($amount), $dec) * $divisor; - for ($div = $divisor / 10; $div > 1; $div /= 10) - { - if ($frac < $div) - $frac = "0" . $frac; - } - //$frac = sprintf("%0{$dec}d", $frac); + $frac = sprintf("%0{$dec}d", round2($frac, 0)); $and = _("and"); $frac = " $and $frac/$divisor"; } -- 2.30.2