static double toSignificantFigures(double value, int figures) { double multiplier = Math.pow(10.0, figures.toDouble() ).toDouble(); return ( value*multiplier ).round() / multiplier; }