From f9d1525420a9257a58100a7905190609b7b17b4c Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Tue, 7 Sep 2010 06:33:48 +0000 Subject: [PATCH 1/1] Ugly bug in javascript number entry formatting code. --- CHANGELOG.txt | 6 +++++- js/utils.js | 7 +++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 4909b54f..880dddc3 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -19,11 +19,15 @@ Legend: ! -> Note $ -> Affected files +07-Sep-2010 Janusz Dobrowolski +# Ugly bug in formating numbers +$ /js/utils.js + 07-Sep-2010 Joe Hunt/Chaitanya ! Removed all decimal roundings in cost price calculations $ /purchasing/includes/db/grn_db.inc /manufacturing/includes/db/work_orders_db.inc - + 06-Sep-2010 Janusz Dobrowolski # Fixed error on new contact add. $ /includes/ui/contacts_view.inc diff --git a/js/utils.js b/js/utils.js index 9b1b1ac4..0474ae23 100644 --- a/js/utils.js +++ b/js/utils.js @@ -219,12 +219,11 @@ function price_format(post, num, dec, label, color) { num = Math.floor(num*decsize+0.50000000001); cents = num%decsize; num = Math.floor(num/decsize).toString(); + for( i=cents.toString().length; i