If you want 2/7 to be returned as 2/7, you must be in CAS view (not Home view) and the Exact box in CAS Settings must be checked.
In Home view, all results are displayed in decimal form, so keying 2/7 returns 0.285714285714 no matter what the settings are. Pressing the fraction key [a b/c] will display it as 2/7 but please note that this is only an approximation, and a display mode for that entry only; the underlying value remains 0.285714285714 internally.
In CAS view, if the Exact CAS mode is turned on, then all exact fractions (entered without any decimal points!) are returned as exact fractions. But if you turn off Exact CAS mode, *or* if you include a decimal point anywhere at all inside the input, then the result will be in decimal (approximate) form. Pressing the fraction button [a b/c] in CAS view is different from what it does in Home view. In CAS, it toggles between executing exact(Ans) which turns Ans into a fraction (approximation), and approx(Ans) which evaluates Ans into a decimal approximation.
The above lets you be in complete control of obtaining exact or approximate results, and toggling between them, as needed.
Disclaimer: I don't work for HP. I just enjoy using their calculators.