How to convert hexadecimal to decimal in a substitution statement?
- by stefanzweig
I have a line like this:
pad (2) = 0x0041
I wanna change the hex into decimal and the expected result is
pad (2) = 65
I just tried :%s/\(.*\) = \(.*\)/\1 = \=printf("%d", submatch(2)), but it failed.
Would you help to solve this? Thank you very much.