Open gedlbauer opened 7 months ago
Hi @gedlbauer
Thank you for your comment.
I do understand your approach but this package is designed to provide an easy, scale-agnostic way to handle/convert same-unit different-scale (i.e., mm, cm, km, etc.) but not different-type units (length vs area, for example)
The above code is equivalent to this:
const length1 = 10;
const length3 = 3;
const results3 = length1 * length3; // 30
Using Length
abstraction for the unit type still should work the same as the above code and be 30.
I think what you're suggesting would be a better fit for something like Area.fromMeterage()
?
There is already a request for a new feature to support arithmetic operations between units see #26 & haimkastner/unitsnet-py#12.
Hope to gather some time to implement it in the future :)
CC: @yuval-po
Hey,
I noticed that you can muliply a length unit by another length:
In my oppinion this is not correct. The result should not be 30 meters, but 30 squaremeters if we want to stay mathematically correct.
The param for length.multiply() should just be a number (as the multiplicator). This would cause in mathematically correct behavior.
Kind regards, Georg