convert numbers to grade scale javascript