MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / round_function

Function round_function

nodedb-query/src/expr_parse/parser.rs:519–525  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

517
518 #[test]
519 fn round_function() {
520 let (expr, deps) = parse_ok("ROUND(price * (1 + tax_rate), 2)");
521 assert_eq!(deps, vec!["price", "tax_rate"]);
522 let doc = Value::from(serde_json::json!({"price": 99.99, "tax_rate": 0.08}));
523 let result = expr.eval(&doc);
524 assert_eq!(result, Value::Float(107.99));
525 }
526
527 #[test]
528 fn concat_function() {

Callers

nothing calls this directly

Calls 2

evalMethod · 0.80
parse_okFunction · 0.70

Tested by

no test coverage detected