src/scene/units.ts/** Display unit systems for the UI (independent of the scene's stored units). */export type UnitSystem = 'imperial' | 'inches';export function formatImperial(inches: number, opts: { precision?: 'inch' | 'eighth' } = {}): string {const sign = inches < 0 ? '-' : '';const abs = Math.abs(inches);const feet = Math.floor(abs / 12);const remIn = abs - feet * 12;if (opts.precision === 'eighth') {const eighths = Math.round(remIn * 8);const whole = Math.floor(eighths / 8);const frac = eighths % 8;const fracStr =frac === 0? '': frac === 4? ' 1/2': frac === 2? ' 1/4'
Showing the first 20 lines.
Get full code