pub fn format_number_script(
canonical: &str,
kind: NumberKind,
locale: &str,
options: &Value,
) -> Result<String, InputError>Expand description
Builds an eval script that formats concretely validated canonical text.
Every dynamic argument is JSON-encoded. The script sends a serde-compatible
Result<String, String> through dioxus.send; JavaScript never handles
instance/revision integers. Capture those in Rust for decode_format_reply.
- Complexity: O(canonical + locale + options bytes) time and space.
§Errors
Returns the numeric validation error or Locale for serialization failure.
§Examples
use adam_web_ui::{components::number::format_number_script, input::NumberKind};
let script = format_number_script("255", NumberKind::Unsigned(8), "en-US",
&serde_json::json!({})).unwrap();