Java tutorial
//package com.java2s; import android.widget.TextView; import java.text.DecimalFormat; public class Main { public static final DecimalFormat dfTwo = new DecimalFormat("###,###,###,###,###,###,###,###,##0.00"); public static void formatDecimal(TextView txt, double number) { txt.setText(dfTwo.format(number)); } }