get ratio within range of 0~1 automatically