Back to project page Ocypode.
The source code is released under:
MIT License
If you think the Android project Ocypode listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.ocypode.utility.formatter; /* w w w . jav a 2 s .c o m*/ import java.util.Formatter; import java.util.Locale; public class CurrencyFormatter { private static Formatter formatter; /** * * @param value = 1000 * @return = 1,000.00 */ public static String formatIncludingDecimal(double value){ StringBuilder sb = new StringBuilder(); formatter = new Formatter(sb, Locale.US); formatter.format("%,.2f", value); return sb.toString(); } }