Java tutorial
import java.text.DecimalFormat; public class Main { public static void main(String args[]) { System.out.println(new DecimalFormat("0.######E0").format(12345)); } } //1.2345E4