Skip to main content

int

Function int 

Source
pub fn int(params: &[Value]) -> NativeResult
Expand description

Converts a Value::Boolean or a Value::String to an integer Value::Number.

  • Declaration: int(value: Any): Number

ยงErrors

Will return NativeError::CustomError if the Value can not be converted to a Number. Will return NativeError::WrongParameterCount if there is a mismatch in the supplied parameters. Will return NativeError::WrongParameterType if the the supplied parameters have the wrong type.