datavzrd 2.64.0

A tool to create visual HTML reports from collections of CSV/TSV tables
1
2
3
4
5
6
7
8
9
10
11
export function precision_formatter(precision, value) {
  if (value == "") {
    return "";
  }
  value = parseFloat(value);
  if (1 / 10 ** precision < Math.abs(value) || value == 0) {
    return value.toFixed(precision).toString();
  } else {
    return value.toExponential(precision);
  }
}