If I have the number already as a string it is not a problem, however this is not always the case
Can you do something to ensure that the number *is* always a string ? That would surely be the best approach ... if it's feasible. (I think this is what jettero was hinting at.)