INNER CODE UNIT · JavaScript

magnitude

oncologylab/fp-tools · src/fp_tools/resources/static_browser/app.js:48

  const magnitude = Math.abs(number);
  if (number === 0) return "0";
  if (magnitude < 0.001 || magnitude >= 1000) return number.toExponential(2);
  return number.toFixed(digits).replace(/\.0+$|(?<=\.[0-9]*[1-9])0+$/g, "");
}
function fmtSci(value) {
  const number = Number(value);
  return Number.isFinite(number)
    ? number.toExponential(1)
    : "NA";
}
function motifLabel(motif) {
  return motif
    ? `${motif.name}${motif.motif_id ? ` (${motif.motif_id})` : ""}`
    : "";
}
function sampleDisplayName(sample, condition = "") {
  if (sample && typeof sample === "object" && sample.display_name)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…