How to show result with Int on calculator?
问题 I am making the calculator app. It shows double at the result even when I don't use double. Example) 1+1 = 2.0 But I want like 1+1= 2 Of course, I want to keep double when there is double like 1.2+1.3= 2.5 How should I have to edit? I tried to edit like this, but there is an error. public void equalsOnClick(View view) { Integer result = null; ScriptEngine engine = new ScriptEngineManager().getEngineByName("rhino"); try { result = (int)engine.eval(workings); } catch (ScriptException e) { Toast