Filtering number for javascript