method Flag.percent
On for p percent (0..100) of the users (by), plus the allow list, minus the deny list.
Example:
fn main() io {
let vip = Flag.percent(0, allow: ["u7"], deny: ["u8"])
let u7 = Principal.User("u7", [], Map.new(), false, none)
let u8 = Principal.User("u8", [], Map.new(), false, none)
print("{vip.on(r#for: u7)} {vip.on(r#for: u8)}")
}Output
true false
pub(api) static fn percent(p: f64, by: FlagBy = .User, allow: List<str> = [], deny: List<str> = []) -> FlagComplexity. O(1).
Since. 1.0.0-beta
Parameters
Returns
Effects
none declared (pure unless the body says otherwise)
Defined in: std/core/dynconf.oxl:759