Skip to content

Commit 0ff00e3

Browse files
authored
Merge pull request #405 from Uzaaft/master
feat: Add ton_per_minute and ton_per_day
2 parents aab4751 + 81869b3 commit 0ff00e3

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/si/mass.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ quantity! {
5454
@ton_assay: 2.916_667_E-2; "AT", "assay ton", "assay tons";
5555
@ton_long: 1.016_047_E3; "2240 lb", "long ton", "long tons";
5656
@ton_short: 9.071_847_E2; "2000 lb", "short ton", "short tons";
57-
@ton: 1.0_E3; "t", "ton", "tons"; // ton, metric
57+
/// Ton Metric
58+
@ton: 1.0_E3; "t", "ton", "tons";
5859
}
5960
}

src/si/mass_rate.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,14 @@ quantity! {
9595
"short tons per second";
9696
@ton_short_per_hour: 2.519_957_5_E-1; "2000 lb/h", "short ton per hour",
9797
"short tons per hour";
98-
@ton_per_second: 1.0_E3; "t/s", "ton per second",
99-
"tons per second"; // ton per second, metric
98+
/// Ton per second, metric.
99+
@ton_per_second: 1.0_E3; "t/s", "ton per second", "tons per second";
100+
/// Ton per minute, metric.
101+
@ton_per_minute: 1.666_666_666_666_666_6_E1; "t/min", "ton per minute", "tons per minute";
102+
/// Ton per hour, metric.
103+
@ton_per_hour: 2.777777777777778_E-1; "t/h", "ton per hour", "tons per hour";
104+
/// Ton per day, metric.
105+
@ton_per_day: 1.157_407_407_407_407_4_E-2; "t/d", "ton per day", "tons per day";
100106
}
101107
}
102108

@@ -165,6 +171,9 @@ mod test {
165171
test::<m::ton_short, t::second, r::ton_short_per_second>();
166172
test::<m::ton_short, t::hour, r::ton_short_per_hour>();
167173
test::<m::ton, t::second, r::ton_per_second>();
174+
test::<m::ton, t::minute, r::ton_per_minute>();
175+
test::<m::ton, t::hour, r::ton_per_hour>();
176+
test::<m::ton, t::day, r::ton_per_day>();
168177

169178
fn test<M: m::Conversion<V>, T: t::Conversion<V>, R: r::Conversion<V>>() {
170179
Test::assert_approx_eq(&MassRate::new::<R>(V::one()),

0 commit comments

Comments
 (0)