MCPcopy Create free account
hub / github.com/csskit/csskit / round_dp

Function round_dp

crates/chromashift/src/lib.rs:304–307  ·  view source on GitHub ↗
(f: f64, d: u32)

Source from the content-addressed store, hash-verified

302pub const COLOR_EPSILON: f64 = 0.0072;
303
304pub fn round_dp(f: f64, d: u32) -> f64 {
305 let factor = 10u32.pow(d) as f64;
306 (f * factor).round() / factor
307}

Callers

nothing calls this directly

Calls 1

roundMethod · 0.80

Tested by

no test coverage detected