# FlexUnits |\> Simplify: extended capability suggestion

**URL:** <https://discourse.julialang.org/t/flexunits-simplify-extended-capability-suggestion/139367>\
**Category:** General Usage\
**Created:** [September 11, 2026, 4:16pm UTC](https://discourse.julialang.org/t/flexunits-simplify-extended-capability-suggestion/139367 "2026-09-11T16:16:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jake](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jake/32/46007_2.png) [@Jake](https://discourse.julialang.org/u/Jake)\
**Post date:** [September 11, 2026, 4:16pm UTC](https://discourse.julialang.org/t/flexunits-simplify-extended-capability-suggestion/139367/1 "2026-09-11T16:16:52Z")

</div>

A bit of background, I first started using [MathCad](https://en.wikipedia.org/wiki/Mathcad)around 1993. This was the way I became familiar with units aware calculation software. A big step up from spreadsheets! Let me walk you through an example. Here := is set equal to and = is show me the value of the variable.

 ![Screenshot 2026-09-11 115959](https://global.discourse-cdn.com/julialang/original/3X/5/0/5059ae5aae1a18eca83e5f48f22016f9bee4402c.png)

- In the first line I am setting torque to be 100 ft lbs.
- When I display it, the default SI units are Joules as the units for energy and torque are the same.
- Since I don’t like that, I edit the box to the right of the units (third line) and type in the desired unit.
- In the 4th line I changed the units to the desired N\*m
- Similarly in the 5th line they are in\*lbf
- in the 6th line I mixed up lb(m) and lbf so it automatically inserted the SI units to give a dimensionally consistent unit output.
- it also corrected the units for the 7th line, where I had typed in W

I am wondering if the simplify function in FlexUnits can be extended to give a similar behaviour. Something like the behaviour of the first line remains the same, but if I add units like the last line below that its behaviour mirrors the MathCad behaviour?

```julia-auto
julia> torque = 100u"ft lbf" |> simplify
135.5817456 (N*m)

julia> torque = 100u"ft lbf" |> simplify(u"J")

```

Perhaps there are even better ideas out there?

The intent is to be able to display the output in my desired units, rather than base SI units or the default simplification rules. The example above shows that there are two valid ways to simplify some sets of base units.

---

<div class="post-metadata">

**Author:** ![Nathan\_Boyer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nathan_boyer/32/14825_2.png) [@Nathan\_Boyer](https://discourse.julialang.org/u/Nathan_Boyer)\
**Post date:** [September 11, 2026, 4:36pm UTC](https://discourse.julialang.org/t/flexunits-simplify-extended-capability-suggestion/139367/2 "2026-09-11T16:36:34Z")

</div>

I think this is what you want, and it already works. Just drop the `simplify`.

```julia-auto
julia> using FlexUnits, .UnitRegistry

julia> torque = 100u"ft lbf" |> u"J"
135.5817456 J

```

---

<div class="post-metadata">

**Author:** ![Jake](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jake/32/46007_2.png) [@Jake](https://discourse.julialang.org/u/Jake)\
**Post date:** [September 11, 2026, 5:33pm UTC](https://discourse.julialang.org/t/flexunits-simplify-extended-capability-suggestion/139367/3 "2026-09-11T17:33:22Z")

</div>

Thanks, that gets a long way there. I missed that in the documentation.

I would find it useful if it did not error on incorrect units but rather displayed the requested units and added the required units to give correct results as shown below

```julia-auto
julia> torque = 100u"ft lbf" |> u"W"
135.5817456 W s # This would be my desired result, instead of an error

```

---

<div class="post-metadata">

**Author:** ![Deduction42](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/deduction42/32/9206_2.png) [@Deduction42](https://discourse.julialang.org/u/Deduction42)\
**Post date:** [September 11, 2026, 5:57pm UTC](https://discourse.julialang.org/t/flexunits-simplify-extended-capability-suggestion/139367/4 "2026-09-11T17:57:31Z")

</div>

Throwing errors on incompatible unit conversions (i.e. with mismatching dimensions) is a core feature in pretty much every units package as it enforces correctness. If you’re running a long calculation, and the result cannot be converted to the desired units, it’s likely that there’s a mistake in the calculation.

In fact, when I originally made the falling object example in the documentation [here](https://deduction42.github.io/FlexUnits.jl/stable/examples/#The-problem-definition), I originally forgot to divide the force by mass to get acceleration. The unitless baseline results looked weird but I didn’t want to go through everything line by line because I was going to add units anyway. When I added units, the error made the mistake obvious. Errors thrown by units packages have literally saved weeks of my life from tedious debugging. This is a major reason why I’m such a heavy user of units packages and developed my own.

---

<div class="post-metadata">

**Author:** ![Nathan\_Boyer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nathan_boyer/32/14825_2.png) [@Nathan\_Boyer](https://discourse.julialang.org/u/Nathan_Boyer)\
**Post date:** [September 11, 2026, 6:04pm UTC](https://discourse.julialang.org/t/flexunits-simplify-extended-capability-suggestion/139367/5 "2026-09-11T18:04:59Z")

</div>

> [@Jake](#):
>
> `torque = 100u"ft lbf" |> u"W"`

The error message in your example is pretty good. It tells you that `s` is what’s missing from your target unit. I consider it a feature that Julia keeps you in the loop and forces an explicit correction instead of silently adjusting itself to the closest valid solution it can find.

```julia-auto
ERROR: ConversionError: Cannot convert unit '(m² kg)/s²' to target unit 'W' due to a dimension mismatch of 's'

```
