Is Long or double : Float « Date Type « Android






Is Long or double

    

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.charset.Charset;

class Main {

    public static boolean isLong(String text) {
        try {
            new Long(text);
            return true;
        } catch (NumberFormatException e) {
            return false;
        }
    }

    public static boolean isDouble(String text) {
        try {
            new Double(text);
            return true;
        } catch (NumberFormatException e) {
            return false;
        }
    }
}

   
    
    
    
  








Related examples in the same category

1.Convert a float to 16.16 fixed-point representation
2.Convert a 16.16 fixed-point value to floating point
3.Random and Roundup
4.calculate NormDiff
5.DecimalFormat, Maximum Fraction Digits
6.Format Distance
7.Gives the fractional part of a number
8.Close to a value
9.Value equals in a range, and ensure value inside a range
10.scale, round Number
11.Returns the smallest power of two that is greater than