MCPcopy Create free account
hub / github.com/apache/datafusion / trim_trailing_0s

Function trim_trailing_0s

datafusion/spark/src/function/string/format_string.rs:2421–2430  ·  view source on GitHub ↗
(number: &str)

Source from the content-addressed store, hash-verified

2419}
2420
2421fn trim_trailing_0s(number: &str) -> &str {
2422 if number.contains('.') {
2423 for (i, c) in number.chars().rev().enumerate() {
2424 if c != '0' {
2425 return &number[..number.len() - i];
2426 }
2427 }
2428 }
2429 number
2430}
2431
2432fn trim_trailing_0s_hex(number: &str) -> &str {
2433 for (i, c) in number.chars().rev().enumerate() {

Callers 3

format_floatMethod · 0.85
format_decimal_fixedMethod · 0.85

Calls 2

containsMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…