diff --git a/html/js/calc.js b/html/js/calc.js index dd42d0785..5460a7bfb 100644 --- a/html/js/calc.js +++ b/html/js/calc.js @@ -38,6 +38,12 @@ function cal() try { Compute(); + p_variable=p_variable.replace(/[a-z]/,''); + p_variable=p_variable.replace(/[A-Z]/,''); + p_variable=p_variable.replace(/,''); + p_variable=p_variable.replace(/%/,''); + p_variable=p_variable.replace(/;/,''); + p_variable=p_variable.replace(/>/,''); p_variable=p_variable.replace(/ /g,""); p_variable=p_variable.replace(/\+/g,"+ "); p_variable=p_variable.replace(/-/g,"- "); @@ -52,9 +58,8 @@ function cal() alert_box("Mauvaise formule\n"+p_variable); return false; } - p_history=p_history+'
Total :"+p_variable+" = "+result.toString()+"
"; + p_history=p_variable+"="+result.toString()+'