Here you can find the source of getScientificNotation(double value)
public static String getScientificNotation(double value)
//package com.java2s; //License from project: Apache License import java.math.RoundingMode; import java.text.DecimalFormat; import java.text.NumberFormat; public class Main { public static final int NUMBER_DECIMAL_PLACES = 4; public static String getScientificNotation(double value) { NumberFormat formatter = new DecimalFormat("0.0E0"); formatter.setRoundingMode(RoundingMode.HALF_UP); formatter.setMinimumFractionDigits(NUMBER_DECIMAL_PLACES); return formatter.format(value); }/*from w w w . j a v a2s . c o m*/ }