X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=js%2Futils.js;h=781382b32b12ecfedf593393fd12e443436dfd87;hb=cb94dfbeb6c9ca86a05399a7c92a76260697eb20;hp=900db5b08d20245dd0c384f96d4cee8d7e7bce66;hpb=24e131303687a261917bc8bb31e3ce0e6f00d57e;p=fa-stable.git diff --git a/js/utils.js b/js/utils.js index 900db5b0..781382b3 100644 --- a/js/utils.js +++ b/js/utils.js @@ -213,12 +213,12 @@ function price_format(post, num, dec, label, color) { num = "0"; sign = (num == (num = Math.abs(num))); var max = dec=='max'; - if(max) dec = 15 - Math.floor(Math.log(Math.abs(num))); + if(max) dec = num==0 ? 2 : 15 - Math.floor(Math.log(Math.abs(num))); if(dec<0) dec = 2; decsize = Math.pow(10, dec); num = Math.floor(num*decsize+0.50000000001); cents = num%decsize; - num = Math.floor(num/decsize).toString(); + num = Math.floor(num/decsize).toString(); for( i=cents.toString().length; i