From a18afc4e842e59452ead1b69097441bc10d3a6ff Mon Sep 17 00:00:00 2001 From: mat Date: Fri, 9 Feb 2024 21:52:34 -0600 Subject: [PATCH] fix mb,gb,tb,pb in calculator --- src/engines/answer/calc.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/engines/answer/calc.rs b/src/engines/answer/calc.rs index 61b435b..0c7b053 100644 --- a/src/engines/answer/calc.rs +++ b/src/engines/answer/calc.rs @@ -103,6 +103,32 @@ pub static FEND_CONTEXT: Lazy = Lazy::new(|| { // make lowercase f and c work context.define_custom_unit_v1("f", "f", "°F", &fend_core::CustomUnitAttribute::Alias); context.define_custom_unit_v1("c", "c", "°C", &fend_core::CustomUnitAttribute::Alias); + + context.define_custom_unit_v1( + "mb", + "mbs", + "megabyte", + &fend_core::CustomUnitAttribute::Alias, + ); + context.define_custom_unit_v1( + "gb", + "gbs", + "gigabyte", + &fend_core::CustomUnitAttribute::Alias, + ); + context.define_custom_unit_v1( + "tb", + "tbs", + "terabyte", + &fend_core::CustomUnitAttribute::Alias, + ); + context.define_custom_unit_v1( + "pb", + "pbs", + "petabyte", + &fend_core::CustomUnitAttribute::Alias, + ); + // make random work context.set_random_u32_fn(rand::random::);