diff options
Diffstat (limited to 'src/utils.rs')
| -rw-r--r-- | src/utils.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/utils.rs b/src/utils.rs index 4b56dc6..2713241 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -98,3 +98,17 @@ pub async fn bottom_decode(msg: &str) -> String { } } } + +/* + * converts celsius to fahrenheit + */ +pub async fn celsius_to_fahrenheit(c: &f64) -> f64 { + (c * (9.0 / 5.0)) + 32.0 +} + +/* + * converts fahrenheit to celsius + */ +pub async fn fahrenheit_to_celsius(f: &f64) -> f64 { + (f - 32.0) * (5.0 / 9.0) +} |
