BrightSide Workbench Full Report + Source Code
org.turro.elephant.util.DecimalFormats Class Reference

Static Public Member Functions

static String format (Number value, String pattern)
 
static String format (Number value)
 
static String format (double value, String pattern)
 
static String format (double value)
 
static String format (long value, String pattern)
 
static String format (long value)
 
static String formatCurrency (double value)
 
static String formatPercent (double value)
 
static String getStringFormat (int fractionDigits)
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 28 of file DecimalFormats.java.

Member Function Documentation

◆ format() [1/6]

static String org.turro.elephant.util.DecimalFormats.format ( double  value)
static

Definition at line 44 of file DecimalFormats.java.

44  {
45  return DecimalFormat.getNumberInstance(Application.getUsedLocale()).format(value);
46  }
Here is the call graph for this function:

◆ format() [2/6]

static String org.turro.elephant.util.DecimalFormats.format ( double  value,
String  pattern 
)
static

Definition at line 40 of file DecimalFormats.java.

40  {
41  return new DecimalFormat(pattern, new DecimalFormatSymbols(Application.getUsedLocale())).format(value);
42  }
Here is the call graph for this function:

◆ format() [3/6]

static String org.turro.elephant.util.DecimalFormats.format ( long  value)
static

Definition at line 52 of file DecimalFormats.java.

52  {
53  return DecimalFormat.getIntegerInstance(Application.getUsedLocale()).format(value);
54  }
Here is the call graph for this function:

◆ format() [4/6]

static String org.turro.elephant.util.DecimalFormats.format ( long  value,
String  pattern 
)
static

Definition at line 48 of file DecimalFormats.java.

48  {
49  return new DecimalFormat(pattern, new DecimalFormatSymbols(Application.getUsedLocale())).format(value);
50  }
Here is the call graph for this function:

◆ format() [5/6]

static String org.turro.elephant.util.DecimalFormats.format ( Number  value)
static

Definition at line 35 of file DecimalFormats.java.

35  {
36  if(value == null) return null;
37  return DecimalFormat.getNumberInstance(Application.getUsedLocale()).format(value);
38  }
Here is the call graph for this function:

◆ format() [6/6]

static String org.turro.elephant.util.DecimalFormats.format ( Number  value,
String  pattern 
)
static

Definition at line 30 of file DecimalFormats.java.

30  {
31  if(value == null) return null;
32  return new DecimalFormat(pattern, new DecimalFormatSymbols(Application.getUsedLocale())).format(value);
33  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ formatCurrency()

static String org.turro.elephant.util.DecimalFormats.formatCurrency ( double  value)
static

Definition at line 56 of file DecimalFormats.java.

56  {
57  return DecimalFormat.getCurrencyInstance(Application.getUsedLocale()).format(value);
58  }
Here is the call graph for this function:

◆ formatPercent()

static String org.turro.elephant.util.DecimalFormats.formatPercent ( double  value)
static

Definition at line 60 of file DecimalFormats.java.

60  {
61  return DecimalFormat.getPercentInstance(Application.getUsedLocale()).format(value);
62  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getStringFormat()

static String org.turro.elephant.util.DecimalFormats.getStringFormat ( int  fractionDigits)
static

Definition at line 64 of file DecimalFormats.java.

64  {
65  StringBuilder sb = new StringBuilder("#,##0");
66  if(fractionDigits > 0) {
67  sb.append(".");
68  for(int i = 0; i < fractionDigits; i++) {
69  sb.append("0");
70  }
71  }
72  return sb.toString();
73  }
Here is the caller graph for this function:

The documentation for this class was generated from the following file: