結局こういうのにした。

double GetPrecision(const string value)
{
int length = value.size();
int dotPos = value.find(".");

if(dotPos>=0) return pow(10., 1+dotPos-length);
else return 1.;
}