ivy: %g for rationals

Still need to trim trailing zeros and decimals.