File tree Expand file tree Collapse file tree 1 file changed +16
-10
lines changed Expand file tree Collapse file tree 1 file changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -369,16 +369,22 @@ impl FormatSpec {
369
369
Some ( FormatType :: Number ) => {
370
370
Err ( "Format code 'n' for object of type 'float' not implemented yet" )
371
371
}
372
- Some ( FormatType :: GeneralFormatUpper ) => Ok ( float_ops:: format_general (
373
- precision,
374
- magnitude,
375
- float_ops:: Case :: Upper ,
376
- ) ) ,
377
- Some ( FormatType :: GeneralFormatLower ) => Ok ( float_ops:: format_general (
378
- precision,
379
- magnitude,
380
- float_ops:: Case :: Lower ,
381
- ) ) ,
372
+ Some ( FormatType :: GeneralFormatUpper ) => {
373
+ let precision = if precision == 0 { 1 } else { precision } ;
374
+ Ok ( float_ops:: format_general (
375
+ precision,
376
+ magnitude,
377
+ float_ops:: Case :: Upper ,
378
+ ) )
379
+ }
380
+ Some ( FormatType :: GeneralFormatLower ) => {
381
+ let precision = if precision == 0 { 1 } else { precision } ;
382
+ Ok ( float_ops:: format_general (
383
+ precision,
384
+ magnitude,
385
+ float_ops:: Case :: Lower ,
386
+ ) )
387
+ }
382
388
Some ( FormatType :: ExponentUpper ) => Ok ( float_ops:: format_exponent (
383
389
precision,
384
390
magnitude,
You can’t perform that action at this time.
0 commit comments