Here you can find the source of formatUnwithE(Object arg)
Parameter | Description |
---|---|
arg | like: double falot String .... e.g:1.0E-8 |
public static String formatUnwithE(Object arg)
//package com.java2s; // %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt import java.math.BigDecimal; public class Main { /**//w w w .j a v a 2s. c om * DOC Administrator Comment method "formatUnwithE". In java when double more than six decimal that use toString * will rentru contains E scientific natation. * * @param arg like: double falot String .... e.g:1.0E-8 * @return 0.00000001 as String */ public static String formatUnwithE(Object arg) { String doubleString = String.valueOf(arg); int index = doubleString.indexOf("E"); if (index != -1) { return (new BigDecimal(doubleString)).toPlainString(); } return doubleString; } }