(specifier, value)
| 9761 | } |
| 9762 | |
| 9763 | function formatPrefix(specifier, value) { |
| 9764 | var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = "f", specifier)), |
| 9765 | e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3, |
| 9766 | k = Math.pow(10, -e), |
| 9767 | prefix = prefixes[8 + e / 3]; |
| 9768 | return function(value) { |
| 9769 | return f(k * value) + prefix; |
| 9770 | }; |
| 9771 | } |
| 9772 | |
| 9773 | return { |
| 9774 | format: newFormat, |