fromjson: convert value to number