ivy: %g for int and bigint

Not yet for rationals.
Trailing zeros and decimals not deleted.

Change-Id: I2ded214a8858293059c02433f19be130379f21d3