Use java.text.DecimalFormat to format integer
import java.text.DecimalFormat; public class Main { public static void main(String args[]) { System.out.println(new DecimalFormat("0.#####E0").format(123456)); } } //1.23456E5