Ejemplo n.º 1
0
 /**
  * Create a new <code>Money</code> instance from the given amount using the default currency.
  *
  * @param amount the amount of money.
  */
 public Money(double amount) {
   this(Currency.getDefaultCurrency(), amount);
 }
Ejemplo n.º 2
0
  /**
   * Return a <code>String</code> representation of the given amount of money in the default
   * currency.
   *
   * @param value the value of the money
   * @return the string representation.
   */
  public static String toString(double value) {
    NumberFormat format = Currency.getDefaultCurrency().getNumberFormat();

    return format.format(value);
  }