pub fn compare(a: &str, b: &str) -> OrderingExpand description
Compare two sort keys as table.ts does: numerically when both are numbers.
use fc_dioxus::behavior::sort::compare;
use std::cmp::Ordering;
assert_eq!(compare("9", "10"), Ordering::Less);
assert_eq!(compare("12,480", "9"), Ordering::Greater);
assert_eq!(compare("item 2", "item 10"), Ordering::Less);
assert_eq!(compare("apple", "Banana"), Ordering::Less);