Here you can find the source of formatFloat(String value)
Parameter | Description |
---|---|
value | The value validation is being performed on. |
public static Float formatFloat(String value)
//package com.java2s; //License from project: Open Source License public class Main { /**//w w w . j a v a 2s.co m * Checks if the value can safely be converted to a float primitive. * * @param value The value validation is being performed on. * @return format result */ public static Float formatFloat(String value) { if (value == null) { return null; } try { return new Float(value); } catch (NumberFormatException e) { return null; } } }