Use the below snippet :
public static Long convertStringToLong(String stringValue) { try{ NumberFormat numberFormat = NumberFormat.getInstance(); Number number = numberFormat.parse(stringValue); return number.longValue(); }catch(Exception e){ return null; } }
Manohar Changed status to publish June 24, 2021