Grams, ounces and the value underneath
The formula builder is still not finished. It is very close. In the meantime, the units system landed, and it is worth a post of its own. Plan.Make.Trace now lets every maker work in the units they actually use, and none of that changes the numbers underneath.
What we built
Units in Plan.Make.Trace now have three separate layers, and the separation is the whole point.
Canonical storage. Every measurement is stored as a whole number in a fixed base unit: milligrams for mass, seconds for time, tenths of a degree Celsius for temperature, microliters for volume. That never changes, whoever is looking at it.
User preferences. Each maker picks a unit for mass, temperature, volume and shipping mass, independently. Grams, kilograms, ounces or pounds. Celsius or Fahrenheit. Milliliters, liters, or US and imperial fluid ounces and gallons.
Field-level presentation. Each field in the product decides how a preference applies to it. It can follow the maker's preference, or fix its own unit where only one makes sense, and it can control how the value is scaled and how precisely it is shown.
The problem it solves
Our first version was the usual switch: metric or imperial, one setting for the whole app. It lasted about as long as it took to think about how makers actually work.
Someone might formulate in grams, take their temperatures in Fahrenheit and ship in pounds. That is not an edge case, it is just a person in a particular country with a particular set of habits and a particular courier. A single metric/imperial toggle forces them to pick which part of their day gets to be wrong.
So the toggle went, and each measurement got its own preference. Shipping mass got one too, separate from batch mass, because the unit you weigh oils in is rarely the unit you weigh a parcel in.
Preferences alone are not enough, though. The same stored value has to read differently depending on where it appears, and that is a decision for the screen, not the maker.
The challenge: precision
Converting units is easy. Converting them without the numbers quietly changing is where the work is.
An ounce is 28,349.523125 milligrams. No number of ounces you can sensibly type lands exactly on a whole milligram. Every time a value goes from storage to the screen and back, there is a chance to round it, and every rounding is a chance for the stored value to drift. A formula that loses a fraction of a gram every time someone opens and saves it cannot be trusted, and you would never know which save did it.
So rounding happens in exactly one place: when a typed value is converted into its stored unit. Everything else, every display, every comparison, works on the unrounded conversion.
Editing follows the same rule. A field holds the stored value, not the converted one. It shows that value in the maker's unit, and it only writes back when someone actually types. Open a formula, change nothing, save it, and every weight saves exactly what it loaded.
When you do edit, the field starts from the shortest number that converts back to the same stored value. 1,200,000 mg opens as 1200 g, or as 42.32875 oz. That converts to 1,199,999.877 mg, which rounds back to exactly 1,200,000. Drop one more digit and 42.3288 oz lands a milligram high. Round it to 42.33 for neatness and it is 35 mg high.
Exact and approximate
Metric and imperial units do not behave the same way, so they are not shown the same way.
Metric units can represent a stored milligram value exactly, so they do. A read-only metric value shows the fewest digits that equal the stored amount, and never fewer. 1,234.567 g is shown as 1,234.567 g, not tidied up into 1.2 kg. Time works the same: 100 seconds is 100 s, not 1.667 min.
Ounces, pounds and US volumes cannot be exact, so they do not pretend to be. They show five significant digits, which keeps the error to around 0.001% of the amount at any size, whether that is a few grams of fragrance or a full batch of oils.
Unit names come from the maker's language through the browser's own formatting, so a value reads correctly in Japanese without us translating "kg" by hand.
What makes ours different
A simpler approach stores whatever the user typed, in whatever unit they typed it, or converts once on the way in and hopes. Either way, the number in the database depends on who entered it.
Here, presentation never touches storage. Calculations, inventory and traceability all operate on the same predictable integers, regardless of anyone's preferences or how a particular screen chooses to display them. The saponification calculator does not know or care that you think in ounces.
Preferences set the defaults. Fields decide how those defaults apply. Today that means mass, temperature and volume follow the maker's preference across the formula setup, ingredient amounts, the formula review and the printable formula document, while cure time is always entered in hours or minutes, because nobody needs to set a cure time in seconds.
That split is what enables the case this was designed for, even though the current screens do not use it yet. The formula editor can restrict mass to grams, so every ingredient quantity reads on the same scale while you are formulating. The review or batch screen can then show the same stored value scaled up to kilograms, because nobody wants to read 48,000 g of oils off a production sheet. Same value. Different job. The editor and the batch screen each choose what suits them, and the milligrams underneath do not move.
Where Dawnshard comes in
Unit preferences live in Dawnshard, on the app preferences every profile already has, alongside theme, language and currency. They are not soap-specific, so they belong in the core rather than in Plan.Make.Trace.
That placement pays for itself straight away. The unit settings on the profile page are built from the model: the options in each dropdown and the validation behind them come from the Dawnshard definition, not from a list someone has to keep in step on the frontend. Add a unit to the model and it shows up as an option.
What this unlocks
A maker can now set up Plan.Make.Trace the way they actually work, and every number they see respects that. Grams for the formula, Fahrenheit for the stick blender, pounds at the post office.
More importantly, the formula, the inventory and the batch records underneath all agree with each other, to the milligram, no matter how many people in how many regions have opened and edited them.
It also means new screens do not have to solve units again. A field built on the unit-aware form and table components declares what it stores and how it wants to be shown, and the conversion, rounding and formatting are already handled.
What's next
The completed formula builder. Every stage from oils through additives, scent and Liquids & Lye, and the finished workspace as a soaper will use it, now in whatever units they prefer.
Liked this post? Tap the heart to let us know.
Get early access
Be the first to hear about early access, roadmap updates, and exclusive early adopter pricing.
Join the early access list