Java Float Number Create toFloat(Object o)

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

Description

to Float

License

Open Source License

Declaration

public static Float toFloat(Object o) 

Method Source Code

//package com.java2s;

public class Main {
    public static Float toFloat(Object o) {
        Float f;//from w  w  w  .  ja va 2 s  .com
        if (o instanceof Float) {
            f = (Float) o;
        } else {
            try {
                f = Float.valueOf(o.toString());
            } catch (Exception e) {
                f = null;
            }
        }
        return f;
    }
}

Related

  1. toFloat(Number value)
  2. toFloat(Object _inStrObj)
  3. toFloat(Object anObj)
  4. toFloat(Object literal)
  5. toFloat(Object o)
  6. toFloat(Object o)
  7. toFloat(Object ob, Float defaultFloat)
  8. toFloat(Object obj)
  9. toFloat(Object obj)