[core] Move ratio to size converter to core