hallo
i need 2 deal with each digit after the floating point.
ex . 12.5678
i need 2 compare the 12.5 with another number and then the 12.56 and then 12.567 and so on till 4 digits

is there is a function that takes the int number and one number after the floating point from the whole float number

You can get the parts by doing this

float a=12.5678;
int whole_part=a;
float dec_part=a-whole_part;

If you want only one decimal part try this

float dec_part_1=((int)(dec_part*10))/10;

If you want two, replace the 10 with 100 and so on.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.