Java Float Number Create toFloat(final Object obj)

Here you can find the source of toFloat(final Object obj)

Description

to Float

License

Open Source License

Declaration

private static Float toFloat(final Object obj) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    private static Float toFloat(final Object obj) {
        Float f = null;//w ww. j a v  a 2s .  com
        if (obj != null) {
            if (obj instanceof Double) {
                f = ((Double) obj).floatValue();
            } else if (obj instanceof Float) {
                f = (Float) obj;
            }
        }
        return f;
    }
}

Related

  1. toFloat(double[] v)
  2. toFloat(final byte[] ba)
  3. toFloat(final byte[] inputBytes, final int offset)
  4. toFloat(final Integer value)
  5. toFloat(final Object o, final String pattern)
  6. toFloat(final Object valueRep)
  7. toFloat(final String value)
  8. toFloat(final String value)
  9. toFloat(final String value)