This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Format javascript number as an actually-readable string | |
// using different d3.formats for different magnitudes. | |
// If it's NaN or otherwise not a number (ie a string), pass it through. | |
// For instance: | |
// 0.0000103 -> 10.3µ | |
// 0.000103 -> 0.000103 | |
// 0.103 -> 0.103 | |
// 10.34 -> 10.3 | |
// 1034 -> 1,034 | |
// 1034.1 -> 1,034.1 |