(
tick: ScaleTick,
opt?: IntervalScaleGetLabelOpt
)
| 314 | } |
| 315 | |
| 316 | getLabel( |
| 317 | tick: ScaleTick, |
| 318 | opt?: IntervalScaleGetLabelOpt |
| 319 | ): string { |
| 320 | if (tick == null) { |
| 321 | return ''; |
| 322 | } |
| 323 | |
| 324 | let precision = opt && opt.precision; |
| 325 | |
| 326 | if (precision == null) { |
| 327 | precision = getPrecision(tick.value) || 0; |
| 328 | } |
| 329 | else if (precision === 'auto') { |
| 330 | // Should be more precise then tick. |
| 331 | precision = this._cfg.intervalPrecision; |
| 332 | } |
| 333 | |
| 334 | // (1) If `precision` is set, 12.005 should be display as '12.00500'. |
| 335 | // (2) Use `round` (toFixed) to avoid scientific notation like '3.5e-7'. |
| 336 | const dataNum = round(tick.value, precision as number, true); |
| 337 | |
| 338 | return addCommas(dataNum); |
| 339 | } |
| 340 | |
| 341 | } |
| 342 |
nothing calls this directly
no test coverage detected