Format monetary Value - Android java.lang

Android examples for java.lang:Double

Description

Format monetary Value

Demo Code

import java.text.DecimalFormat;

public class Main {

  /** String to money */
  public static String monetaryValue(double money) {
      String str = new DecimalFormat("###,###,##0.00").format(money);
    str = String.format("%s%s", "c", str);
    return str;/*from w ww . ja  v  a  2s .c  o  m*/
  }

}

Related Tutorials