Check out example codes for "calculating noof digits after decimal point in c++". It will help you in understanding the concepts better.

Code Example 1

//float is f string fs=to_string(f); //since C++ 11 int digitsAfterFloatingPoins=fs.substr(1, fs.find(".")).length(); 

Learn ReactJs, React Native from akashmittal.com