MCPcopy Index your code
hub / github.com/endbasic/endbasic / format_double

Function format_double

std/src/strings.rs:51–53  ·  view source on GitHub ↗

Formats a double `d` for display.

(d: f64)

Source from the content-addressed store, hash-verified

49
50/// Formats a double `d` for display.
51pub fn format_double(d: f64) -> String {
52 if !d.is_nan() && d.is_sign_negative() { d.to_string() } else { format!(" {}", d) }
53}
54
55/// Parses a string `s` as a double.
56pub fn parse_double(s: &str) -> Result<f64, String> {

Callers 2

execMethod · 0.85
execMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected