Skip to main content

string

Function string 

Source
pub fn string(
    value: &JValue,
    prettify: Option<bool>,
) -> Result<JValue, FunctionError>
Expand description

$string(value, prettify) - Convert value to string

  • undefined inputs return undefined (but this is handled at call site)
  • strings returned unchanged
  • functions/lambdas return empty string
  • non-finite numbers (Infinity, NaN) throw error D3001
  • other values use JSON.stringify with number precision
  • prettify=true uses 2-space indentation