iliekturtles / uom

Units of measurement -- type-safe zero-cost dimensional analysis

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add newton_per_square_millimeter in Pressure

Eagle941 opened this issue · comments

As per title, would it be possible to add newton_per_square_millimeter as available unit under Pressure?

Easily!

Add a definition for the unit in the units { ... section:

uom/src/si/pressure.rs

Lines 36 to 40 in 34538a9

@zeptopascal: prefix!(zepto); "zPa", "zeptopascal", "zeptopascals";
@yoctopascal: prefix!(yocto); "yPa", "yoctopascal", "yoctopascals";
@atmosphere: 1.013_25_E5; "atm", "atmosphere", "atmospheres";
@atmosphere_technical: 9.806_65_E4; "at", "atmosphere (technical)",

And a test at the bottom:

uom/src/si/pressure.rs

Lines 131 to 135 in 34538a9

test::<f::zeptonewton, a::square_meter, p::zeptopascal>();
test::<f::yoctonewton, a::square_meter, p::yoctopascal>();
test::<f::dyne, a::square_centimeter, p::dyne_per_square_centimeter>();
test::<f::kilogram_force, a::square_millimeter, p::kilogram_force_per_square_millimeter>();

PRs welcome, otherwise I can get to this after reviewing a couple open PRs.

Thank you for your answer! I have just opened #397