File tree Expand file tree Collapse file tree 2 files changed +6
-35
lines changed Expand file tree Collapse file tree 2 files changed +6
-35
lines changed Original file line number Diff line number Diff line change @@ -7755,12 +7755,12 @@ def get_values_for_csv(
7755
7755
if float_format is None and decimal == "." :
7756
7756
mask = isna (values )
7757
7757
7758
- if not quoting :
7759
- values = values . astype ( str )
7760
- else :
7761
- values = np .array (values , dtype = "str" ) # Convert float16 -> string
7762
- values = values .astype (float , copy = False ) # Parse string -> Python float64
7763
-
7758
+ # GH60699
7759
+ # Ensure quoting don't add extra decimal places in output for float16, float32
7760
+ if values . dtype in [ np . float16 , np . float32 ] :
7761
+ values = np .array (values , dtype = "str" )
7762
+ values = values .astype (float , copy = False )
7763
+
7764
7764
values = values .astype (object , copy = False )
7765
7765
values [mask ] = na_rep
7766
7766
return values
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments