Skip to content
This repository was archived by the owner on Jul 2, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ public class CalculationContext implements Serializable {
private String unit;
private DecimalFormat df;


/** @param precision specifies the number of digits to include after the decimal
* point when converting the values to string format
* (see {@link java.text.DecimalFormat#setMaximumFractionDigits(int) })
*/
public CalculationContext(String unit, int precision) {

if (unit == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ public boolean registerForStatistics(String key, Number value){
return registerForStatistics(key, value,"",1);
}

/** @param precision specifies the number of digits to include after the decimal
* point when converting the values to string format
* (see {@link CalculationContext#CalculationContext(java.lang.String, int) })
*/
public boolean registerForStatistics(String key, Number value, String unit, int precision) {
if (!contextForCalculations.containsKey(key)) {
contextForCalculations.put(key, new CalculationContext(unit, precision));
Expand Down