BUG/CLN: Clean float / complex string formatting
State: closed

Noticed while working on another bug. The _is_number helper here is wrong and can cause incorrect results given that this code path is hit by arbitrary strings (e.g., it thinks "foo" is a number). Also the _trim_zeros_complex helper apparently does nothing:
```python
[ins] In [3]: _trim_zeros_float(["0.00000"])
Out[3]: ['0.0']

[ins] In [4]: _trim_zeros_complex(["1.000+1.000000j"])
Out[4]: ['1.000+1.000000j']
```

Labels:
name: Output-Formatting
description: __repr__ of pandas objects, to_string

Comments:
> Also the _trim_zeros_complex helper apparently does nothing:

something is wrong then.

_trim_zeros_complex was 'fixed' in #25745, why is test_to_string_complex_float_formatting not failing? has there been some other refactor since?
> _trim_zeros_complex was 'fixed' in #25745, why is test_to_string_complex_float_formatting not failing? has there been some other refactor since?

My guess is it's passing because there are no zeros to trim in the test case.

Instead of trimming zeros it's as though zeros are added; I would expect the formatting behavior instead to be similar to float for both the real and imaginary parts (below is master):

```python
[ins] In [4]: s = pd.Series([0.000, 1.000])
         ...: print(s)
         ...:
         ...: s = pd.Series([0.000+1.000j, 1.000+1.000j])
         ...: print(s)
         ...:
0    0.0
1    1.0
dtype: float64
0    0.000000+1.000000j
1    1.000000+1.000000j
dtype: complex128
```

Should I open an issue about this, and either close this PR or turn it into a bug fix?
> can you run some asv's i am not sure this is really hit much, but maybe

```
       before           after         ratio
     [a975a754]       [229b5fc1]
     <master>         <fix-is-numeric-helper>
+      1.84±0.1ms       2.37±0.2ms     1.28  io.csv.ReadCSVCachedParseDates.time_read_csv_cached(False)
+     4.16±0.09ms       4.86±0.5ms     1.17  io.csv.ReadCSVFloatPrecision.time_read_csv_python_engine(',', '.', 'high')
-     6.88±0.07ms      6.18±0.09ms     0.90  io.hdf.HDFStoreDataFrame.time_store_info

SOME BENCHMARKS HAVE CHANGED SIGNIFICANTLY.
PERFORMANCE DECREASED.

-----

       before           after         ratio
     [a975a754]       [229b5fc1]
     <master>         <fix-is-numeric-helper>
-     6.88±0.03ms      6.07±0.04ms     0.88  io.hdf.HDFStoreDataFrame.time_store_info
-        24.4±1ms       16.2±0.2ms     0.66  io.hdf.HDFStoreDataFrame.time_read_store_table_wide

SOME BENCHMARKS HAVE CHANGED SIGNIFICANTLY.
PERFORMANCE INCREASED.

-----

BENCHMARKS NOT SIGNIFICANTLY CHANGED.

-----

       before           after         ratio
     [a975a754]       [229b5fc1]
     <master>         <fix-is-numeric-helper>
+      18.5±0.4ms       24.4±0.7ms     1.32  io.csv.ReadCSVThousands.time_thousands(',', None)
+      17.7±0.8ms       22.4±0.6ms     1.26  io.csv.ReadCSVThousands.time_thousands(',', ',')
+      17.9±0.6ms         21.8±1ms     1.22  io.csv.ReadCSVThousands.time_thousands('|', ',')
-     6.94±0.08ms      6.14±0.04ms     0.89  io.hdf.HDFStoreDataFrame.time_store_info
-     2.09±0.08ms      1.78±0.03ms     0.85  io.csv.ReadCSVFloatPrecision.time_read_csv(';', '_', 'high')
-        5.63±1ms      3.95±0.03ms     0.70  io.csv.ReadCSVFloatPrecision.time_read_csv_python_engine(',', '.', 'high')
-      23.6±0.7ms       16.1±0.6ms     0.68  io.hdf.HDFStoreDataFrame.time_read_store_table_wide

SOME BENCHMARKS HAVE CHANGED SIGNIFICANTLY.
PERFORMANCE DECREASED.

-----

BENCHMARKS NOT SIGNIFICANTLY CHANGED.
```

Ran the IO asvs a few times and results aren't consistent. Maybe there's something going on with io.csv / io.hdf but hard to say.
lgtm can you add a whatsnew note and ping on green.
> lgtm can you add a whatsnew note and ping on green.

@jreback Added note + green
thought we had merged this, thanks @dsaxton