mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-01 21:58:12 +08:00
Sci notation on continuous legend (#1450)
* sci notation on continuous legend * significant digits
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
/*
|
||||
via https://github.com/nodef/extra-number/blob/master/scripts/significantDigits.js
|
||||
*/
|
||||
|
||||
export default (n) => {
|
||||
return n
|
||||
.toExponential()
|
||||
.replace(/e[\+\-0-9]*$/, "")
|
||||
.replace(/^0\.?0*|\./, "").length;
|
||||
};
|
||||
Reference in New Issue
Block a user