Skip to main content

Type Alias: SetDimensionsUnit()

SetDimensionsUnit = (unit) => Promise<void>

Function

Sets the unit of measurement for dimension displays.

This action changes which unit system is used when showing product dimensions - switching between metric (millimeters, centimeters, meters) and imperial (inches, feet) measurements. It's like changing the ruler you're using to measure something, ensuring measurements appear in the format most familiar and useful to the user.

Business value:

  • Ensures measurements are shown in the customer's preferred or regional standard
  • Reduces confusion by displaying dimensions in familiar units
  • Supports international sales by accommodating different measurement systems
  • Helps customers make accurate space planning decisions in their local context

Parameters

unit

UnitLength & string

The unit of length to use for dimension displays (e.g., 'mm', 'cm', 'm', 'inch', 'ft')

Returns

Promise<void>

Promise that resolves when the unit has been updated

Example

// Switch to metric measurements (centimeters)
window.mimeeqApp.actions.setDimensionsUnit('cm');

// Switch to imperial measurements (inches)
window.mimeeqApp.actions.setDimensionsUnit('inch');

// Add a unit selector to your interface
document.getElementById('unit-selector').addEventListener('change', (e) => {
window.mimeeqApp.actions.setDimensionsUnit(e.target.value);
});