Arreglado horrible error con el parseo matematico

This commit is contained in:
Daniel Cortes
2019-01-06 13:02:02 -03:00
parent b8d66f0472
commit 3ee8b5c10c
6 changed files with 156 additions and 112 deletions

View File

@@ -82,7 +82,9 @@ public class NumberFormatedTextField extends JTextField {
*/
private void readValue(){
String currentText = this.getText();
Expression expression = new Expression(currentText);
String stripedDots = currentText.replace(".", "");
Expression expression = new Expression(stripedDots);
if(expression.checkSyntax()){
this.value = (int) Math.floor(expression.calculate());
}else{