Added nounit and tobase functions

This commit is contained in:
2023-06-14 09:24:34 -07:00
parent aa02b35cc5
commit 061f58ba53
6 changed files with 83 additions and 35 deletions

View File

@ -51,7 +51,7 @@ impl FreeUnit {
}
// Get this unit in terms of base units
pub fn get_base(&self) -> Quantity {
pub fn to_base(&self) -> Quantity {
let q = self.whole.base_factor();
let mut q = q.unwrap_or(Quantity::new_rational_from_string("1").unwrap());