How can one determine programatically how many points are in a pip?

 
For most brokers a pip is equivalent to a point, i.e. GBP/USD is quoted to 4 decimal places. A point is 0.0001 and so is a pip.

However, one of my brokers (Tradeview) quote to 10ths of a pip. For them GBP/USD is quoted to 5 decimal places, 0.00001, but a pip is still 0.0001, so a pip is actually 10 points.

Since I am trying to write portable MQL4 code how can one determine programatically how many points constitute a pip?
 
Try this:

if( StringFind(Symbol(), "JPY", 0) >= 0) {
   myPoint = 0.01;
   pointsInPip = myPoint/Point;
}
else {
   myPoint = 0.0001;
   pointsInPip = myPoint/Point;
}



 
Thanks phy, that is ideal.

Presumably then pairs that use JPY as either the base or quote currency always have a pip value of 0.01 and all other pairs always have a pip value of 0.0001.
 
JPY only appears on the right side, and is the only (that I know of) pair that quotes in 2 digits (normally)
Reason: