Summary
Spawned from Code Review #1 (Math Libraries / i18n).
Two call sites use JavaScript’s Number.prototype.toFixed instead of toFixed / toFixedNumber from scenerystack/dot (or locale-aware formatting):
src/common/view/VernierScaleNode.ts — main-scale label text: value.toFixed(placesFor(value))
src/caliper/view/CaliperNode.ts — trimmed() helper: value.toFixed(3) for engraved marks
Why it matters
- CRC /
scenerystack-numerics: never use native Number.toFixed (cross-browser rounding).
- User-facing readings already go through
readingProperties.ts + Intl so French/Spanish get 23,14. Abstract scale labels on the Principle / shared scale views still show . as the separator, so locale switching leaves the comb inconsistent with the readout.
Suggested fix
- Use
toFixed from scenerystack/dot at minimum.
- For labels meant as UI (not engraved instrument realism), prefer
Intl.NumberFormat / the same helpers as readingProperties.ts, keyed off localeProperty.
- Caliper/micrometer engraved numerals may stay period-based for instrument fidelity — still switch off native
toFixed.
Summary
Spawned from Code Review #1 (Math Libraries / i18n).
Two call sites use JavaScript’s
Number.prototype.toFixedinstead oftoFixed/toFixedNumberfromscenerystack/dot(or locale-aware formatting):src/common/view/VernierScaleNode.ts— main-scale label text:value.toFixed(placesFor(value))src/caliper/view/CaliperNode.ts—trimmed()helper:value.toFixed(3)for engraved marksWhy it matters
scenerystack-numerics: never use nativeNumber.toFixed(cross-browser rounding).readingProperties.ts+Intlso French/Spanish get23,14. Abstract scale labels on the Principle / shared scale views still show.as the separator, so locale switching leaves the comb inconsistent with the readout.Suggested fix
toFixedfromscenerystack/dotat minimum.Intl.NumberFormat/ the same helpers asreadingProperties.ts, keyed offlocaleProperty.toFixed.