Ringgit ends almost flat against greenback