MCPcopy Create free account
hub / github.com/ccusage/ccusage / number_field

Function number_field

rust/crates/ccusage/src/adapter/codebuff/parser.rs:459–465  ·  view source on GitHub ↗
(record: &serde_json::Map<String, Value>, key: &str)

Source from the content-addressed store, hash-verified

457}
458
459fn number_field(record: &serde_json::Map<String, Value>, key: &str) -> f64 {
460 record
461 .get(key)
462 .and_then(Value::as_f64)
463 .filter(|value| value.is_finite() && *value > 0.0)
464 .unwrap_or(0.0)
465}
466
467fn pick_u64(record: &serde_json::Map<String, Value>, keys: &[&str]) -> u64 {
468 keys.iter()

Callers 2

extract_assistant_usageFunction · 0.85
parse_usage_objectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected