Java Float Number Create toFloat(Object value)

Here you can find the source of toFloat(Object value)

Description

to Float

License

Open Source License

Declaration

public static final float toFloat(Object value) 

Method Source Code

//package com.java2s;

public class Main {
    public static final float toFloat(Object value) {
        if (value instanceof Number)
            return ((Number) value).floatValue();
        else if (value == null)
            return 0;
        else/*from  w  w w. j  a va2  s .co m*/
            return Float.parseFloat(value.toString());
    }

    public static final String toString(Object value) {
        if (value == null)
            return null;

        return value.toString();
    }
}

Related

  1. toFloat(Object v)
  2. toFloat(Object val)
  3. toFloat(Object val)
  4. toFloat(Object value)
  5. toFloat(Object value)
  6. toFloat(Object value)
  7. toFloat(short half)
  8. toFloat(short[] arr)
  9. toFloat(short[] src)