What do you mean you changed "0" to 48 and it worked? I'm sure it worked fine with "0".
You must stop mixing up the interpreted ZX BASIC with PBP.

In PBP lingo
48
$30
%00110000
"0"
are all representing the exact same thing, just differently for human readability.
If you were to connect to 8 LEDs to PortB of your PIC and then do PortB = x where x is any of the above they would all result in the exact same thing being displayed on the LEDs.

So, in your specific example subtracting "0" will subtract the numeric value 48 from the numeric value of the ASCII code for the digit question. This will result a numeric value equal to that of 'the digit'.