I was looking at some of the special characters for use in a status line, and I found one that shows the percentage through file of displayed window (`%P`). However, I can find no way of getting this value through a function or a command that is provided by default. I did see that this is the value displayed by the `ruler` option, but as far as I know, there is no way of capturing that value. How do you get this percentage?

### Note

I know about the `:file` command, but that doesn't display the percentage I want. (you can capture this value with the `:redir` command)