BrightSide Workbench Full Report + Source Code
org.turro.math.Round Class Reference

Public Member Functions

 Round (double value)
 
Round decimals (int digits)
 
double perCent (int digits)
 
double value ()
 

Static Public Member Functions

static Round from (double value)
 

Detailed Description

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

Definition at line 24 of file Round.java.

Constructor & Destructor Documentation

◆ Round()

org.turro.math.Round.Round ( double  value)

Definition at line 28 of file Round.java.

28  {
29  this.value = value;
30  }
Here is the caller graph for this function:

Member Function Documentation

◆ decimals()

Round org.turro.math.Round.decimals ( int  digits)

Definition at line 32 of file Round.java.

32  {
33  double tmp = Math.pow(10.0, digits);
34  value = ((double) Math.floor((value * tmp) + 0.5555555)) / tmp;
35  return this;
36  }
Here is the caller graph for this function:

◆ from()

static Round org.turro.math.Round.from ( double  value)
static

Definition at line 49 of file Round.java.

49  {
50  return new Round(value);
51  }
Round(double value)
Definition: Round.java:28
Here is the call graph for this function:
Here is the caller graph for this function:

◆ perCent()

double org.turro.math.Round.perCent ( int  digits)

Definition at line 38 of file Round.java.

38  {
39  value *= 100.0;
40  return decimals(digits).value();
41  }
Round decimals(int digits)
Definition: Round.java:32
Here is the call graph for this function:
Here is the caller graph for this function:

◆ value()

double org.turro.math.Round.value ( )

Definition at line 43 of file Round.java.

43  {
44  return value;
45  }

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