You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
publicstaticletquart=try!Units.Unit.register(
name:"quart",
symbol:"qt",
dimension:[.Length:3],
coefficient:0.0009463529 // This is the conversion to kiloliters
)
Problem:
It was not obvious to me that the coefficient should be the scalar conversion to kiloliters. I had to dig around the list of defined units to find the [.Length: 3] one with coefficient: 1.
Then I had to Google "quart to kiloliter" which gave me this long coefficient that I'm not sure how accurate it is. But I already know that a quart is 1/4 gallon (exactly).
Then I had to Google "quart to kiloliter" which gave me this long coefficient that I'm not sure how accurate it is. But I already know that a quart is 1/4 gallon (exactly).
I'm definitely not opposed to adding this API. But to be completely honest, I'm not sure I want to invest much effort personally because these units should just be statically defined once, and cutting out the client doing a little math on the front side doesn't seem like a huge benefit.
I would be super interested in an MR adding quart to our list of default units though!
Situation: I want to define "quart".
This is currently how I have to do it.
Problem:
coefficient
should be the scalar conversion to kiloliters. I had to dig around the list of defined units to find the[.Length: 3]
one withcoefficient: 1
.Desired Solution:
The text was updated successfully, but these errors were encountered: