Rationalize
[x]Rationalize
[x, $d_x$]Rationalize[2.2]
For negative x, -Rationalize[-x] == Rationalize[x]
which gives symmetric results:
Rationalize[-11.5, 1]
Not all numbers can be well approximated.
Rationalize[N[Pi]]
Find the exact rational representation of N[Pi]
Rationalize[N[Pi], 0]