Lets say that input from the user is a decimal number, ex. 5.2155 (having 4 decimal digits). It can be stored freely (int,double) etc.
Is there any
Years after the fight but as I have made my own solution in three lines :
string number = "543.014"; size_t dotFound; stoi(number, &dotFound)); string(number).substr(dotFound).size()
Of course you have to test before if it is really a float (With stof(number) == stoi(number) for example)
stof(number) == stoi(number)