About 65,700 results
Open links in new tab
  1. Convert float to String and String to float in Java - Stack Overflow

    How could I convert from float to string or string to float? In my case I need to make the assertion between 2 values string (value that I have got from table) and float value that I have calculated.

  2. java - How to nicely format floating numbers to string without ...

    Apr 1, 2009 · A 64-bit double can represent integer +/- 2 53 exactly. Given this fact, I choose to use a double type as a single type for all my types, since my largest integer is an unsigned 32 …

  3. Guia definitiva de conversión de tipos en Java - Stack Overflow en ...

    Guia definitiva de conversión de tipos en Java Convertir String a Integer Convertir Integer a String Convertir char a String Convertir String a char Convertir String a Double Convertir Double a Str...

  4. java - How to check if a string is 'float' or 'int' - Stack Overflow

    Apr 1, 2017 · I have a string, and I know that it only contains a number. How can I check if this number is int or float?

  5. How to print a float with 2 decimal places in Java?

    In short, the %.2f syntax tells Java to return your variable (val) with 2 decimal places (.2) in decimal representation of a floating-point number (f) from the start of the format specifier (%).

  6. java - Format Float to n decimal places - Stack Overflow

    Mar 4, 2011 · I need to format a float to "n"decimal places. was trying to BigDecimal, but the return value is not correct... public static float Redondear(float pNumero, int …

  7. how to convert a string to float and avoid using try/catch in java?

    Dec 3, 2011 · Float f = Floats.tryParse("10.1"); Float g = Floats.tryParse("invalid.value"); The result will be null if the value is an invalid int or float, and you can then handle it in any way you …

  8. java - Convert string to float? - Stack Overflow

    Jan 17, 2012 · Read the Java API for float here You can construct a new float from a string. There are also other ways to do it. Please use Google.

  9. Convert string to decimal number with 2 decimal places in Java

    Jan 16, 2017 · I just want to be sure that the float number will also have 2 decimal places after converting that string. You can't, because floating point numbers don't have decimal places.

  10. How to convert hex string to float in Java? - Stack Overflow

    May 18, 2011 · How to convert hexadecimal string to single precision floating point in Java? For example, how to implement: float f = HexStringToFloat("BF800000"); // f should now contain …