Repository: pandas-dev/pandas
Issue category: Feature Request

Issue:
DOC: Add examples for float_format in to_csv documentation
### Pandas version checks

- [X] I have checked that the issue still exists on the latest versions of the docs on `main` [here](https://pandas.pydata.org/docs/dev/)


### Location of the documentation

https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.to_csv.html

### Documentation problem

The float_format parameter in to_csv is explained but lacks examples. Users might struggle to understand how to apply this parameter effectively without concrete examples in the documentation.

### Suggested fix for documentation

I suggest adding examples for float_format to make the documentation more beginner-friendly. Examples could include:

```
# Format floats to two decimal places
df.to_csv("example1.csv", float_format="%.2f")

# Use scientific notation
df.to_csv("example2.csv", float_format="{:.2e}".format)
```


Hints:
take

Patch:
diff --git a/pandas/core/generic.py b/pandas/core/generic.py
index a6be17a654aa7..3a48cc8a66076 100644
--- a/pandas/core/generic.py
+++ b/pandas/core/generic.py
@@ -3878,6 +3878,14 @@ def to_csv(
         >>> import os  # doctest: +SKIP
         >>> os.makedirs("folder/subfolder", exist_ok=True)  # doctest: +SKIP
         >>> df.to_csv("folder/subfolder/out.csv")  # doctest: +SKIP
+
+        Format floats to two decimal places:
+
+        >>> df.to_csv("out1.csv", float_format="%.2f")  # doctest: +SKIP
+
+        Format floats using scientific notation:
+
+        >>> df.to_csv("out2.csv", float_format="{{:.2e}}".format)  # doctest: +SKIP
         """
         df = self if isinstance(self, ABCDataFrame) else self.to_frame()
 


Test patch: