<strong>[icu]</strong> Formats a CurrencyAmount. Specialization of format.
@see java.text.Format#format(Object, StringBuffer, FieldPosition)
333447
public StringBuffer format(CurrencyAmount currAmt,
                               StringBuffer toAppendTo,
                               FieldPosition pos) {
        // Default implementation -- subclasses may override
        synchronized(this) {
            Currency save = getCurrency(), curr = currAmt.getCurrency();
            boolean same = curr.equals(save);
            if (!same) setCurrency(curr);
            format(currAmt.getNumber(), toAppendTo, pos);
            if (!same) setCurrency(save);
        }
        return toAppendTo;
    }
589207
public <N extends Number> CellFormatResult format(final String formatPattern, final N value, final Locale locale) {
        return format(new NumberCell<N>(value, formatPattern), locale);
    }
776394
public CellFormatResult format(final String formatPattern, final String value) {
        return format(formatPattern, value, Locale.getDefault());
    }
1353575
public static String format(String format, Object... args) {
    return String.format(Locale.US, format, args);
  }
517109
public StringBuffer format(long number, StringBuffer toAppendTo,
                               FieldPosition status) {
        return format((double)number, toAppendTo, status);
    }
415909
private NumberFormat parseFormatter(Context context, Arguments args)
    {
        final String format = args.get(FORMAT_PARAM_NAME);
        final Locale locale = context.get(LOCALE);
        if (format != null)
        {
            return new DecimalFormat(format, DecimalFormatSymbols.getInstance(locale));
        }

        final Mode mode = Mode.loadFromContext(args, this.defaultMode);
        if (Mode.INTEGER.equals(mode))
        {
            return NumberFormat.getIntegerInstance(locale);
        }
        if (Mode.CURRENCY.equals(mode))
        {
            return NumberFormat.getCurrencyInstance(locale);
        }
        if (Mode.PERCENT.equals(mode))
        {
            return NumberFormat.getPercentInstance(locale);
        }
        return NumberFormat.getInstance(locale);
    }
520052
@Override
   public String formatValue(Object data) {
      if (data instanceof ReportValue) {
         return formatter.formatValue((ReportValue) data);
      } else {
         return String.valueOf(data);
      }
   }
516423
def format_currency(amount, currency)
      
      currency = currency.upcase()
      # assuming that all currencies are split into 100 parts is probably wrong
      # on an i18n scale but it works for USD, EUR and LBP
      # TODO fix this maybe?
      amount = amount / 100.0
      options = {
        # use comma for euro 
        separator: currency == 'EUR' ? ',' : '.', 
        delimiter: currency == 'EUR' ? '.' : ',',
        format: currency == 'EUR' ? '%n %u' : '%u%n',
      }
      case currency
      when 'EUR'
        options[:unit] = '€' 
      when 'LBP'
        options[:unit] = '£'
      when 'USD'
        options[:unit] = '$'
      else
        options[:unit] = currency
      end
      return number_to_currency(amount, options)
    end
1181228
public static String format(final double num) {
		final NumberFormat dFormatter = new DecimalFormat("#0.00");
		final String sFformatter = dFormatter.format(num);
		return format(sFformatter + "");
	}
1321258
public StringBuffer format(Object obj, StringBuffer toAppendTo, FieldPosition pos) {
        if (obj instanceof Date) {
            return format((Date) obj, toAppendTo);
        } else if (obj instanceof Calendar) {
            return format((Calendar) obj, toAppendTo);
        } else if (obj instanceof Long) {
            return format(((Long) obj).longValue(), toAppendTo);
        } else {
            throw new IllegalArgumentException("Unknown class: " +
                (obj == null ? "<null>" : obj.getClass().getName()));
        }
    }
1043251
@Override
	public void format(Buffer buf) {
		int pos = 0;
		// initial the number of records as 0
		setVal(buf, pos, Constant.defaultInstance(INTEGER));
		int flagSize = Page.maxSize(BIGINT);
		pos += Page.maxSize(INTEGER);
		// set flags
		for (int i = 0; i < flags.length; i++) {
			setVal(buf, pos, new BigIntConstant(flags[i]));
			pos += flagSize;
		}
		int slotSize = BTreePage.slotSize(sch);
		for (int p = pos; p + slotSize <= Buffer.BUFFER_SIZE; p += slotSize)
			makeDefaultRecord(buf, p);
	}
1264588
public final String format(android.icu.math.BigDecimal number) {
        return format(number, new StringBuffer(),
                      new FieldPosition(0)).toString();
    }
600431
public static String format(Object o, String pattern, Locale locale, String timezone) {
        if (null == o) return "";
        return format(null, o, pattern, locale, timezone);
    }
783902
public StringBuffer format(double number, StringBuffer toAppendTo,
                               FieldPosition status) {
        // find the number
        int i;
        for (i = 0; i < choiceLimits.length; ++i) {
            if (!(number >= choiceLimits[i])) {
                // same as number < choiceLimits, except catchs NaN
                break;
            }
        }
        --i;
        if (i < 0) i = 0;
        // return either a formatted number, or a string
        return toAppendTo.append(choiceFormats[i]);
    }
1289068
def format_currency_field(__, prec, number, locale):
    """"""
    locale = Locale.parse(locale)
    currency = get_territory_currencies(locale.territory)[0]
    if prec is None:
        pattern, currency_digits = None, True
    else:
        prec = int(prec)
        pattern = locale.currency_formats['standard']
        pattern = modify_number_pattern(pattern, frac_prec=(prec, prec))
        currency_digits = False
    return format_currency(number, currency, pattern, locale=locale,
                           currency_digits=currency_digits)
292411
private NumberFormat createFormatter(Locale loc) throws JspException {
        NumberFormat formatter = null;

        if ((type == null) || NUMBER.equalsIgnoreCase(type)) {
            formatter = NumberFormat.getNumberInstance(loc);
        } else if (CURRENCY.equalsIgnoreCase(type)) {
            formatter = NumberFormat.getCurrencyInstance(loc);
        } else if (PERCENT.equalsIgnoreCase(type)) {
            formatter = NumberFormat.getPercentInstance(loc);
        } else {
            throw new JspException(
                    Resources.getMessage("FORMAT_NUMBER_INVALID_TYPE", type));
        }

        return formatter;
    }
821004
@Deprecated
    public StringBuffer format(Object obj, StringBuffer toAppendTo,
            FieldPosition pos) {
        return mf.format(obj, toAppendTo, pos);
    }