How to Sell Products in Decimal Quantities on Shopify

Some products are sold by measurement rather than by unit. Fabric is bought by the meter. Cheese is ordered by the gram. Rope, wire, ribbon, and lumber are all products where a customer might want 1.5 or 2.75 of something.

Shopify's quantity field only accepts whole numbers. You cannot enter 1.5 in the quantity box, and if a customer tries, Shopify rounds it to the nearest integer. There is no setting to enable decimal quantities, and this limitation applies on every Shopify plan.

This article explains the most practical workarounds depending on your product type and how much customisation you want.

Selling products in decimal quantities on Shopify

Why Shopify Does Not Support Decimal Quantities

Shopify is built primarily for physical goods sold in discrete units. A t-shirt comes in whole units. A bottle of shampoo is one bottle. The quantity field was never designed for goods sold by weight, length, or volume.

This is a deliberate architectural choice, not a missing feature that will eventually be added. Shopify's checkout, inventory tracking, and order management all assume integer quantities. Third-party apps can work around this at the display level, but they cannot fundamentally change how Shopify records and processes quantities in the backend.

Workaround 1: Redefine the Unit

The cleanest and simplest workaround is to redefine what one unit means.

Instead of setting the product unit as one meter of fabric, set it as 10 centimetres of fabric. Now the customer who wants 1.5 meters orders 15 units. Two meters becomes 20 units. Half a meter is 5 units.

The advantage of this approach is that it requires zero code changes. The quantity field behaves normally, Shopify inventory tracking works correctly, and you do not need to install anything.

The main thing you need to do is clearly explain the unit convention on the product page. A short note in the product description that says "1 unit = 10 cm. Order 15 units for 1.5 meters" is enough for most customers. You can also add a small conversion table in the description if your customers regularly order in standard lengths.

This approach works well for fabric stores, yarn stores, rope and wire sellers, and any other business where measurements can be converted into smaller but still meaningful units.

Workaround 2: Use Variants as Fixed Length Options

If your customers typically buy in a small number of standard lengths or weights, variants are a cleaner solution than the unit redefinition approach.

Create a single product and add a variant for each common size. For a fabric store, your variants might be: 0.5 meters, 1 meter, 1.5 meters, 2 meters, 3 meters, and 5 meters. Each variant has its own price set accordingly.

The customer picks the length they want from a dropdown rather than entering a quantity. This avoids the decimal issue entirely because quantity stays at one and the selection happens through the variant.

The limitation is that customers cannot buy arbitrary amounts. If someone wants 2.3 meters, they cannot express that exactly. This approach works best when your customers tend to buy in predictable amounts and when you are comfortable pricing each length individually.

Workaround 3: Custom Quantity Selector with JavaScript

If you want a customer-facing experience that shows decimal values, such as a slider or input box that displays 1.5 meters, this can be built with custom JavaScript in your theme.

The way it works is that the displayed value is a decimal, but the value sent to Shopify in the background is a whole number. The script converts what the customer enters. If the customer types 1.5, the script sends 15 to Shopify. If the customer types 2.25, the script sends 225.

The conversion factor must be consistent and must match how you have set up your product units. If 1 unit equals 10 centimetres, then the multiplier is 10. If 1 unit equals 1 millimetre, the multiplier is 1000.

This approach requires editing your theme's JavaScript, specifically the files that handle the add to cart form. It works on any Shopify theme, but the exact file names vary. On Dawn, the relevant file is typically product-form.js. On other themes, look for any file that handles quantity input.

A developer or someone comfortable with Shopify theme code can implement this in a few hours. If you want to test it before committing to custom code, some Shopify apps in the App Store handle this specifically for measurement-based products.

What to Put on the Product Page

Whichever approach you choose, your product page needs to explain how the quantity system works. Do not assume customers will figure it out.

If you are using the unit redefinition approach, the description should state clearly what one unit equals. A short example helps: "Need 2 meters? Add 20 to your cart."

If you are using variants, label them clearly with units. "1 meter" and "1.5 meters" is better than "Size A" and "Size B."

If you are using a custom selector, make sure the input label says "meters" or "grams" rather than "quantity" so the customer knows what they are entering.

Clear instructions eliminate confusion, reduce support emails, and prevent orders where the customer got the quantity wrong and wants a refund.

Inventory Tracking Considerations

If you track inventory in Shopify, the unit redefinition approach requires you to think in your base unit. If you have 50 meters of fabric in stock and your unit is 10 centimetres, your inventory should be set to 500 units. Every 15-unit order removes 150 centimetres from stock.

This makes the numbers in your inventory dashboard less intuitive. Many merchants in this situation keep a separate stock tracking document in something like Google Sheets where they work in real-world units, and use Shopify's inventory purely for operational purposes. If you want to keep that sheet automatically updated rather than exporting manually, you can sync your Shopify inventory to Google Sheets on a schedule.

The variant approach is simpler for inventory tracking. Each variant can have its own stock count, and the numbers correspond directly to the number of those specific lengths you have available.