How do I format in Java a number with its leading sign?
Negative numbers are correctly displayed with leading -, but obviously positive numbers are not
-
API for Formatter provides an example:
Formatter formatter = new Formatter(); System.out.println(formatter.format(Locale.FRANCE, "e = %+10.4f", Math.E)); //e = +2,7183