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 float toFloat(Object value) 

Method Source Code

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

public class Main {
    public static float toFloat(Object value) {
        return (value == null || "null".equals(value.toString())) ? 0 : Float.parseFloat(value.toString().trim());
    }//from w  w w  .  ja va2s  . c om

    public static String toString(Object value) {
        return value == null || "null".equals(value.toString()) ? "" : value.toString();
    }
}

Related

  1. toFloat(Object obj, String pattern)
  2. toFloat(Object rawColor)
  3. toFloat(Object v)
  4. toFloat(Object val)
  5. toFloat(Object val)
  6. toFloat(Object value)
  7. toFloat(Object value)
  8. toFloat(Object value)
  9. toFloat(short half)