[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpcompta-dev] r4626 - phpcompta/trunk/html/js
From: |
phpcompta-dev |
Subject: |
[Phpcompta-dev] r4626 - phpcompta/trunk/html/js |
Date: |
Mon, 19 Dec 2011 10:55:44 +0100 (CET) |
Author: danydb
Date: 2011-12-19 10:55:42 +0100 (Mon, 19 Dec 2011)
New Revision: 4626
Modified:
phpcompta/trunk/html/js/calc.js
Log:
Bug cosmetic : in calculator if the formula is too long, the formula gets out
the frame
Modified: phpcompta/trunk/html/js/calc.js
===================================================================
--- phpcompta/trunk/html/js/calc.js 2011-12-18 21:05:48 UTC (rev 4625)
+++ phpcompta/trunk/html/js/calc.js 2011-12-19 09:55:42 UTC (rev 4626)
@@ -38,6 +38,11 @@
try
{
Compute();
+ p_variable=p_variable.replace(/ /g,"");
+ p_variable=p_variable.replace(/\+/g,"+ ");
+ p_variable=p_variable.replace(/-/g,"- ");
+ p_variable=p_variable.replace(/\//g,"/ ");
+
sub=eval(p_variable);
var result=parseFloat(sub);
result=Math.round(result*100)/100;
@@ -49,7 +54,7 @@
}
p_history=p_history+'<hr>'+p_variable;
p_history+="="+result.toString();
- var str_sub="<hr><b><i> Total :"+p_variable+" =
"+result.toString()+"<I></b>";
+ var str_sub="<hr><p> Total :"+p_variable+" = "+result.toString()+"</p>";
this.document.getElementById("sub_total").innerHTML=str_sub;
this.document.getElementById("listing").innerHTML=p_history;
this.document.getElementById('inp').value="";
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpcompta-dev] r4626 - phpcompta/trunk/html/js,
phpcompta-dev <=