You can possibly use Math.abs() for this.