se.sics.isl.util
Class FormatUtils

java.lang.Object
  extended by se.sics.isl.util.FormatUtils

public class FormatUtils
extends java.lang.Object


Method Summary
static java.lang.String formatAmount(long amount)
          Formats a currency amount as: ddd ddd ddd[.ddd] [M]
static java.lang.String formatDouble(double value)
          Formats a value with two decimals, using spaces to separate thousands as: ddd ddd ddd.dd.
static java.lang.String formatDouble(double value, java.lang.String separator)
          Formats a value with two decimals, using the specified separator to separating thousands as: ddd ddd ddd.dd (with " " as separator).
static java.lang.String formatLong(long value)
          Formats a value using spaces to separate thousands as: ddd ddd ddd.
static java.lang.String formatLong(long value, java.lang.String separator)
          Formats a value using the specified separator to separating thousands as: ddd ddd ddd (with " " as separator).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

formatAmount

public static java.lang.String formatAmount(long amount)
Formats a currency amount as: ddd ddd ddd[.ddd] [M]

Parameters:
amount - the amount to format
Returns:
the formatted amount as a string

formatLong

public static java.lang.String formatLong(long value)
Formats a value using spaces to separate thousands as: ddd ddd ddd.

Parameters:
value - the value to format
Returns:
the formatted value as a string

formatLong

public static java.lang.String formatLong(long value,
                                          java.lang.String separator)
Formats a value using the specified separator to separating thousands as: ddd ddd ddd (with " " as separator).

Parameters:
value - the value to format
separator - the separator to use
Returns:
the formatted value as a string

formatDouble

public static java.lang.String formatDouble(double value)
Formats a value with two decimals, using spaces to separate thousands as: ddd ddd ddd.dd.

Parameters:
value - the value to format
Returns:
the formatted value as a string

formatDouble

public static java.lang.String formatDouble(double value,
                                            java.lang.String separator)
Formats a value with two decimals, using the specified separator to separating thousands as: ddd ddd ddd.dd (with " " as separator).

Parameters:
value - the value to format
separator - the separator to use
Returns:
the formatted value as a string


Copyright © 2007-2009 Association for Trading Agent Research. All Rights Reserved.