Thanks to the notes here I've replaced my pow(10,iDigs) call to a for loop as follows:
// Separator = 10 to the power of number of decimal places
long dSep = 10;
for (int i = 1; i < iDigs; i++) {
dSep *= 10;
}
This allows me to safely pass the number of decimal places as an argument to the function.
Any other ideas?