(value)
| 501 | return resolved; |
| 502 | }; |
| 503 | const formatThreshold = (value) => { |
| 504 | if (!Number.isFinite(value)) return "0.0000"; |
| 505 | if (value >= 1) return value.toFixed(2); |
| 506 | if (value >= 0.1) return value.toFixed(3); |
| 507 | if (value >= 0.01) return value.toFixed(4); |
| 508 | return value.toFixed(5); |
| 509 | }; |
| 510 | const syncThresholdUi = (value) => { |
| 511 | connectionThresholdSlider.value = String(value); |
| 512 | connectionThresholdValue.textContent = formatThreshold(value); |