TST: Adding to_dict numeric consistency test (#22620)
- [x] closes #22620
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`

this is good, thanks @sofiane87 