Function fakedata_generator::gen_int
source · pub fn gen_int(input: impl ToString) -> String
Expand description
Return random integer in range. Must specify 1 or 2 numbers separated by comma.
If 1 argument is specified it is handled as “highest” value and 0
is used as lowest value.
Note: The return type is String
!
§Example
use fakedata_generator::gen_int;
let i = gen_int("1,100".to_string()).parse::<i32>().unwrap();
assert!(i <= 100 && i >= 1)