ParseInt .5
Jul 20, 2005I've noticed that doing:
var x=any number between -1 and 1, like 0.5
parsInt(x)
yields NaN.
I was expecting zero. Is there another way of doing this?
I've noticed that doing:
var x=any number between -1 and 1, like 0.5
parsInt(x)
yields NaN.
I was expecting zero. Is there another way of doing this?
I am looking for an opposed function for ParseInt() . Do you know any?
View 1 Replies View RelatedI need to create a simple calculator in Java. Below is what I have so far; it is not working currently and I'm not sure why. I also needed to add the parseInt function somewhere in the code but I'm not sure where.
import java.util.Scanner;
public class CalcDemo {
public static void main(String[] args){
}
private int valueA;
private int valueB;
private String operator;
private char operatorA;
public int getvalueA() {
return valueA;
} .....