i want to count the digits behind the decimal point. The result i need is eg:
float n = 1,5674; // print There are 4 digits behind the decimal point.
I already got this. But I don't know how to make it work with decimals.
toTest = 1,5674
int i = 0;
do
{
toTest = toTest / 10;
i++;
}
while(Math.Abs(toTest) >= 1);
works perfectly fine, to find the lenght of a number >1. But i can't figure out how to count the decimal places.
I'm a trainee, so please don't butcher me if I overseen the right solution.
best regards