To find numerator in fraction form of given number . For example , for 30.25 , numerator would be 3025.
var num = 0 ; for ( i = 0 ; i < n ; i ++ ) { if ( str . charAt ( i ) != ' ' ) { num = num * 10 + ( str . charAt ( i ) - ' ' ) ; if ( dot_seen == true ) count_after_dot ++ ; } else dot_seen = true ; }