For example, let's examine the value of PRI of firefox with ps, and then see what is the value stored in procfs.
$ ps -o pid,comm,pri,ni 7000
PID COMMAND PRI NI
7000 firefox 19 0
$ cat /proc/7000/stat
7000 (firefox) S 1 6447 6447 0 -1 4194304 3162595 624998 158 10 30467 6903 3360 488 20 0 63 0 464836 9472659456 123045 18446744073709551615 94866409246720 94866409429052 140727418541056 0 0 0 0 4096 33572095 0 0 0 17 2 0 0 342 0 0 94866411526576 94866411528296 94866422095872 140727418542495 140727418542520 140727418542520 140727418544095 0
According to man proc, we will find the value of PRI in the 18th value (counting from 1), so in this case PRI = 20
I want to know why there is such difference between the output of the ps command and the value stored in the /proc stat file?