Drop exponent suggestion when 0
This commit changes numeric literal formatting to drop exponent when exponent is 0.
This commit is contained in:
parent
b9dedf3959
commit
42f2304ce4
1 changed files with 4 additions and 2 deletions
|
@ -157,8 +157,10 @@ impl<'a> NumericLiteral<'a> {
|
|||
}
|
||||
|
||||
if let Some((separator, exponent)) = self.exponent {
|
||||
output.push_str(separator);
|
||||
Self::group_digits(&mut output, exponent, group_size, true, false);
|
||||
if exponent != "0" {
|
||||
output.push_str(separator);
|
||||
Self::group_digits(&mut output, exponent, group_size, true, false);
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(suffix) = self.suffix {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue