Tabnine Logo
FloatConverter.convert
Code IndexAdd Tabnine to your IDE (free)

How to use
convert
method
in
jodd.typeconverter.impl.FloatConverter

Best Java code snippets using jodd.typeconverter.impl.FloatConverter.convert (Showing top 1 results out of 315)

origin: oblac/jodd

  @Test
  void testConversion() {
    FloatConverter floatConverter = new FloatConverter();

    assertNull(floatConverter.convert(null));

    assertEquals(Float.valueOf(1), floatConverter.convert(Integer.valueOf(1)));
    assertEquals(Float.valueOf((float) 1.73), floatConverter.convert(Double.valueOf(1.73D)));
    assertEquals(Float.valueOf((float) 1.73), floatConverter.convert("1.73"));
    assertEquals(Float.valueOf((float) 1.73), floatConverter.convert(" 1.73 "));
    assertEquals(Float.valueOf((float) 1.73), floatConverter.convert(" +1.73 "));
    assertEquals(Float.valueOf((float) -1.73), floatConverter.convert(" -1.73 "));
    assertEquals(Float.valueOf((float) 1.73), floatConverter.convert(new BigDecimal("1.73")));

    try {
      floatConverter.convert("aaaa");
      fail("error");
    } catch (TypeConversionException ignore) {
    }
  }
}
jodd.typeconverter.implFloatConverterconvert

Popular methods of FloatConverter

  • <init>

Popular in Java

  • Updating database using SQL prepared statement
  • getResourceAsStream (ClassLoader)
  • startActivity (Activity)
  • findViewById (Activity)
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • JFileChooser (javax.swing)
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now