check_fraction

Function check_fraction 

Source
pub fn check_fraction(val: &str) -> Result<f64, String>
Expand description

check if a give value is between 0 and 1

§Arguments

  • val: a file path to test for it’s existence

§Returns

  • Err if no

§Example

use filter_clipped::cli::check_fraction;
assert_eq!(check_fraction("0.5").unwrap(), 0.5);