mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
uucore/num_format: the default precision for %g is 6
This commit is contained in:
parent
e341759dfe
commit
4c5326ffa3
1 changed files with 7 additions and 1 deletions
|
@ -286,7 +286,13 @@ impl Formatter for Float {
|
|||
|
||||
let precision = match precision {
|
||||
Some(CanAsterisk::Fixed(x)) => x,
|
||||
None => 0,
|
||||
None => {
|
||||
if matches!(variant, FloatVariant::Shortest) {
|
||||
6
|
||||
} else {
|
||||
0
|
||||
}
|
||||
}
|
||||
Some(CanAsterisk::Asterisk) => return Err(FormatError::WrongSpecType),
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue